use*_*723 11 html javascript select angularjs
我有以下html表单select语句
<select ng-change="setBillGroup()" ng-model="bill.groupId" class="span8" ng-options="d.id as d.name for d in groups"></select>
Run Code Online (Sandbox Code Playgroud)
和js
myApp.controller('myAppController', function($scope, myAppService) {
.....
function setBillGroup(){
console.log("setBillGroup method called!");
......
}
....
});
Run Code Online (Sandbox Code Playgroud)
但由于某种原因,当我在表单中选择某个或另一个时,似乎永远不会调用setBillGroup().
Ufu*_*arı 27
您必须在范围中定义方法.
$scope.setBillGroup = function(){
console.log("setBillGroup method called!");
......
};
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
22681 次 |
| 最近记录: |