【发布时间】:2015-02-02 07:31:59
【问题描述】:
我有这样的表格
<ng-form name="investorQuestionaireForm" ng-show="user && user.investorType">
<input
type="radio"
required
name="recesso"
ng-model="investorQuestionaire.recesso"
ng-change="investorQuestionaireValidation('recesso', investorQuestionaireForm)"/>
<input
type="radio"
required
name="recesso"
ng-model="investorQuestionaire.recesso"
ng-change="investorQuestionaireValidation('recesso', investorQuestionaireForm)"/>
</ng-form>
此表单在指令内:
angular.module('crowdcoreApp').directive('investorForm',function(){
templateUrl: 'views/template/equity_investor_form.html',
restrict: 'E',
scope: {
project: '=project'
},
});
我面临的问题是,当我单击单选按钮时,investorQuestionaire.recesso 的值没有更新,ng-change 函数没有被触发,最重要的是radio 按钮,仍然导致原始(在 html 类和指令范围内)。我认为数据绑定存在一些问题...
对这种行为的可能错误有何建议?
【问题讨论】:
标签: javascript angularjs binding angularjs-directive scope