Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/377.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 具有隔离作用域的内部指令的角度形式_Javascript_Angularjs_Binding_Angularjs Directive_Scope - Fatal编程技术网

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>