1

私は持ってい$scope.number = 1ます。パスを更新するリスナーを追加したい。

うまくいかない私の試み:

function LocationController($scope, $location) {
   $scope.$watch($scope.number, function(path) {
     $location.path('/'+$scope.number);
   });
}

また、$scope.numberオブジェクト、サブオブジェクトはどのように呼ばれますか?

4

1 に答える 1