所以,像这样的代码:
<form ng-controller="MyCtrl as myCtrl"
name="myCtrl.form">
<button type="button"
ng-click="myCtrl.logScope()"
>log scope</button>
</form>
...
controller('MyCtrl', [
'$scope',
function($scope) {
var vm = this;
vm.logScope = function() {
console.log($scope);
}
....
}]);
输出到控制台,该表单已在 下成功发布$scope.myCtrl.form
。那么,有没有人使用这种语法,这样做是否有意/有效?Angular 1.5