我有一个这样的 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>
但是,我想知道为什么我的第一次尝试不起作用,是否可以修复?