AngularJs“控制器作为”语法-澄清?
I controller as xxx
语法 InvoiceController as invoice
告诉角实例化控制器并将其保存在当前范围内的变量发票中。
$scope
但
<input type="number" ng-model="qty" />....controller('InvoiceController', function($scope) { // do something with $scope.qty <--notice
<input type="number" ng-model="invoic.qty" /> <-- notice ....controller('InvoiceController', function() { // do something with this.qty <--notice
问题
相关分类