抱歉,如果标题令人困惑。
我正在将购买的模板转换为 angular.js 应用。
我想使用不同的模块来组织应用。
我还在使用 angular-ui-router 0.2.5 版,它允许使用单独的模块进行路由。
一切都很好,除了我使用的模板看起来像这样:
<div>Global Nav Bar</div>
<div>Content that changes with different states right below Nav Bar</div>
<div class="wrapsContentAndPushesToBottom">
<div>Content that changes with different states at
bottom of page thanks to parent div's class</div>
<div>Global Footer also on bottom of page due
to parent div's class</div>
</div>
由于父包装 div,我很难让全局页脚正常工作。
有人可以帮我让它工作吗?
更新:
我无法获得建议的 ng-include 来处理我的 plunkr 示例:http://plnkr.co/edit/dgNkHX
我也无法使用页脚的命名 View 工作:http://plnkr.co/edit/BO8NDO
最佳答案
我认为您正在寻找 ng-include。 http://docs.angularjs.org/api/ng.directive:ngInclude
这将使您能够将该全局页脚提取到一个单独的文件中,并将其包含在您的模板中。
<div ng-include src="'globalFooter.tpl.html'"></div>
关于angularjs - 如何使用 angular-ui-router v0.2.5(允许模块)在单独的 View 中使用全局页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20404876/