Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/398.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 Pristine不检测表单内部的表单(指令)_Javascript_Angularjs_Forms_Angularjs Directive - Fatal编程技术网

Javascript Pristine不检测表单内部的表单(指令)

Javascript Pristine不检测表单内部的表单(指令),javascript,angularjs,forms,angularjs-directive,Javascript,Angularjs,Forms,Angularjs Directive,我有一个带有一些输入的表单,然后有一个按钮打开一个指令,一个模态弹出框,其中有另一个表单。原始状态不会检测到指令中的更改。 如何解决这个问题 <form name="createFeeForm" <input.... <input.... {{show the data from the something-popover}} <something-popover....</something-pop

我有一个带有一些输入的表单,然后有一个按钮打开一个指令,一个模态弹出框,其中有另一个表单。原始状态不会检测到指令中的更改。 如何解决这个问题

 <form name="createFeeForm"
        <input....
        <input....
        {{show the data from the something-popover}}
        <something-popover....</something-popover>
        <button ng-disabled="createFeeForm.$pristine">SAVE & CLOSE</button>
 </form>
对于指令template.html

<form name="somethingForm">
      <input...
      <input...
      <button ng-disabled="somethingForm.$pristine">SAVE & CLOSE</button>
</form> 

父pristine将检测输入标记上的所有输入更改,除了指令

我有类似的情况,当它是另一个表单中的表单时,我无法触发任何形式的行为。我没有使用指令,它直接在同一个文件上

我用的是这样的东西:

表单在href上触发一个模态id在我的情况下,我需要传递一个id,所以我使用了一个函数:

<a data-toggle="modal" ng-click="passId(id)" href="#modalDirective">Open Modal</a>
然后,在表单外部,添加指令通常我在页面末尾执行:

</form>
<something-popover....</something-popover>
当页面呈现时,Angular将加载模板,并且可以访问模式,而yopu将有两个单独的表单供您处理


希望有帮助

您可能不应该将模态表单嵌套在另一个表单中。这将是无效的HTML。