-1
所以,我有此控制器:如何從角度模型中獲取元素?
angular.module('example', []).controller('ctrl', function($scope) {
$scope.data = '' // Here, I want to know the element this property is binded to..
});
及以下標記:
<div ng-controller="ctrl">
...
<input type="text" ng-model="data" required>
...
</div>
現在我該怎樣通過綁定進去控制器輸入元素?換句話說,我如何獲得$scope.data
上綁定的元素?
嗯..你是絕對正確的。謝謝! – nhaa123 2014-10-17 12:56:19