I have $scope.number = 1. I want to add a listener to update the path.
My try which doesn't work:
function LocationController($scope, $location) {
$scope.$watch($scope.number, function(path) {
$location.path('/'+$scope.number);
});
}
Also, how is $scope.number called, object, subobject?