我有一个像这样的HTML元素
<section ng-include src="'/views/barfoo.html'" ng-form="myForm"/>
运行此代码时出现以下错误:
Error: [$compile:ctreq] Controller 'form', required by directive 'form', can't be found!
现在我找到了一个解决方案,就像这样
<section ng-form="myForm">
<div ng-include src="'/views/barfoo.html'"/>
</section>
但是,我想知道为什么我的第一次尝试不起作用以及是否可以修复?