84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
controllers.controller('ctrl', ['$scope', function($scope) { console.log($scope);// $scope.add = function() { console.log($scope);// }; }]);
为什么上面两个作用域的输出是不相等的?
Both outputs point to the $scope bound to the controller. The first one is executed when the controller is loaded, and the second one is executed when the add method is called. The execution time and status of the two are different.
It is the same object in itself, and the execution content may be different at different times
Both outputs point to the $scope bound to the controller. The first one is executed when the controller is loaded, and the second one is executed when the add method is called. The execution time and status of the two are different.
It is the same object in itself, and the execution content may be different at different times