通过单选按钮更改值不会调用该方法

时间:2015-03-18 05:51:21

标签: javascript jquery angularjs

我有一个带两个单选按钮的HTML。

 <div data-toggle="buttons">
                   <label class="btn active">
                   <input type="radio" ng-model="value" value="ongoing" ng-change="update(value)">Ongoing
                   </label>                               
                   <label class="btn">
                   <input type="radio" ng-model="value" value="completed" ng-change="update(value)">Past 
                   </label>
             </div>

当我切换单选按钮时,js文件中的方法没有被调用。

JS

$scope.update = function(value){
console.log("the click value is"+value)     
}

0 个答案:

没有答案