意外的ng-change行为

时间:2013-11-18 22:18:31

标签: angularjs

查看来自AngularJS in Action的练习,我正在尝试实施ng-change行为,以便在更改{{1}时更新select的下拉值}。

JS

story.status

请注意,当我选择一个故事时,$scope.setCurrentStatus = function(status) { if(typeof $scope.currentStory !== 'undefined') { $scope.currentStory.status = status.name; } }; $scope.setCurrentStory = function(story) { $scope.currentStory = story $scope.currentStatus = $scope.statusesIndex[story.status]; $scope.currentType = $scope.typesIndex[story.type]; console.log("$scope.currentType", $scope.currentType); }; 的记录会执行,而不是setCurrentStory

HTML

setCurrentStatus

小提琴 - http://jsfiddle.net/qLue3/1/

0 个答案:

没有答案
相关问题