Why does segment need to be attached to $scope? Is it being used somewhere outside of the controller?