Angular JS渲染部分来自不同的模块

时间:2014-10-30 06:11:15

标签: angularjs module render partial

Hello经验丰富的灯/ ror / ios dev。在这里完成平均堆叠超级菜鸟。

背景:

我想在家中渲染SignUp部分

home dir位于核心模块下,带有主控制器 注册在带有AuthenticationController的用户模块下

使用MEANJS样板脚手架和Yeoman


我最初将我的表单放在home.client.view.html中,但它不是模块化的,希望保持Signup with Users模块

这是我悲伤的尝试

<section data-ng-controller="AuthenticationController">
     <div data-ng-include data-ng-src="signup.client.view.html"></div>
</section>

在核心客户端内部我添加了用户模块

ApplicationConfiguration.registerModule('core');
ApplicationConfiguration.registerModule('users');

我做错了什么

请不要链接文档

1 个答案:

答案 0 :(得分:0)

您只需将模板的源代码放在引号中(此示例立即在ng-include部分定义源代码):

<div data-ng-include="'signup.client.view.html'"></div>

这是Plunker Example