Javascript 具有隔离作用域的内部指令的角度形式
我有一张这样的表格Javascript 具有隔离作用域的内部指令的角度形式,javascript,angularjs,binding,angularjs-directive,scope,Javascript,Angularjs,Binding,Angularjs Directive,Scope,我有一张这样的表格 <ng-form name="investorQuestionaireForm" ng-show="user && user.investorType"> <input type="radio" required name="recesso" ng-model="investorQuestionaire.recesso" ng-change="in
<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>
我面临的问题是,当我单击单选按钮时,investorQuestionaire.recesso
的值没有更新,没有触发ng change
函数,而且大多数单选按钮仍然是原始的(在html类和指令范围中)。我认为数据绑定存在一些问题
关于此行为的可能错误有何建议?您的单选按钮似乎没有值
向单选按钮添加一些值,然后重试。比如说
<ng-form name="investorQuestionaireForm" ng-show="user && user.investorType">
<input
type="radio"
required
value="option1"
name="recesso"
ng-model="investorQuestionaire.recesso"
ng-change="investorQuestionaireValidation('recesso', investorQuestionaireForm)"/>
<input
type="radio"
required
value="option2"
name="recesso"
ng-model="investorQuestionaire.recesso"
ng-change="investorQuestionaireValidation('recesso', investorQuestionaireForm)"/>
</ng-form>
<ng-form name="investorQuestionaireForm" ng-show="user && user.investorType">
<input
type="radio"
required
value="option1"
name="recesso"
ng-model="investorQuestionaire.recesso"
ng-change="investorQuestionaireValidation('recesso', investorQuestionaireForm)"/>
<input
type="radio"
required
value="option2"
name="recesso"
ng-model="investorQuestionaire.recesso"
ng-change="investorQuestionaireValidation('recesso', investorQuestionaireForm)"/>
</ng-form>