Difference between $scope and this in controller context?
This question already has an answer here:
The difference is the scope of the object you're interacting with. $scope
is an object injected into your controller. Your controller is an object representative of a given piece of your angular application.
Earlier on in Angular, controllers weren't objects. They are now.
You should be fine going either way (if you're concerned about which is correct), but controller as
is a little more concise.
上一篇: AngularJS:迭代对象时代码不工作