所以,代码如下:
<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