我很迷惑.如果我ng-app每页只能使用一次,我如何在不同的.js文件中使用位于不同模块中的指令.看:
<script src='mainModule.js'/>
<script src='secondModule.js'/>
<body ng-app='mainModule'>
<my-thingy/>
<div>
<other-thingy/>
</div>
</body>
mainModule.js:
angular.module("mainModule",[]).directive("myThingy",function(){ ... })
secondModule.js:
angular.module("secondModule",[]).directive("otherThingy",function(){ ... })
Run Code Online (Sandbox Code Playgroud)
那么,我现在如何指向页面上的secondModule,而不是从mainModule.js引用它
angularjs ×1