我正在创建一个有角度的应用,并且有一个奇怪的问题。
这是我的控制者:
angular.module('clientApp')
.controller('AdminCtrl', function ($scope) {
});
这是我的观点:
<div class="admin" ng-controller="AdminCtrl">
<div ng-include="'/views/partials/header-admin.html'"></div>
<p>This is the admin view.</p>
</div>
当我运行应用程序时,ng-include出现了注释:
<!-- ngInclude: '/views/partials/header-admin.html' -->
但如果我删除了我的视图的ng-controller,它会毫无问题地呈现ng-include:
<div class="admin" >
<div ng-include="'/views/partials/header-admin.html'"></div>
<p>This is the admin view.</p>
</div>
HTML:
<div ng-include="'/views/partials/header-admin.html'" class="ng-scope"><header class="ng-scope">
<div class="logo">
<div class="user-preferences"></div>
</div></header>
<nav class="left-nav ng-scope">
<ul>
<li>
<a href="#">Dashboard</a>
</li>
<li>
<a href="#">Temas (Materias)</a>
</li>
<li>
<a href="#">Sitios</a>
</li>
<li>
<a href="#">Grupos</a>
</li><!--
<li>
<a href="#">Dashboard</a>
</li> -->
</ul>
</nav></div>