所以我想为我的侧栏内容添加一个ng-include,但它不起作用。ng-include使用范围变量不起作用
app.js
...
gvhsApp.controller('MainController', function($scope) {
$scope.template = 'views/mainSidebar.html';
});
的index.html
...
<div class="col-md-4">
<div ng-include src="template"> </div>
</div>
我没有看到我的铬控制台的任何错误。可能是我没有正确指向文件位置?
编辑:
目录结构
app/
js/
app.js
views/
index.html
templates/
mainSidebar.html
build/
js/
app.js
views/
index.html
mainSidebar.html
构建目录是在我的服务器看着
你可能需要做的:'
' – xbonez 2014-10-30 02:07:10