我遇到了在ion-nav-bar中使用ng-include的問題。 ng-include(d)ion-nav-bar代碼不顯示(雖然包含它)。ng-include不顯示ion-nav-bar
的代碼如下:
<ion-view title="test">
<ng-include src="'partials/header-list.html'"></ng-include>
<ion-content padding="false">Test</ion-content>
<ng-include src="'partials/footer-badges.html'"></ng-include>
</ion-view>
泛音的內容/報頭-list.html是:
<ion-nav-bar class="bar-positive">
<ion-nav-back-button class="button button-clear ion-chevron-left"> Back </ion-nav-back-button>
</ion-nav-bar>
<ion-nav-buttons side="right"><a href="#/app/home" class="button button-clear"> Home </a></ion-nav-buttons>
這被渲染成:
<ng-include src="'partials/header-list.html'" class=""><ion-nav-bar class="bar-positive bar bar-header nav-bar nav-title-slide-ios disable-user-behavior invisible">
<ion-nav-back-button class="button button-clear back-button ng-hide"> Back </ion-nav-back-button>
<div class="buttons left-buttons"> </div><h1 ng-bind-html="title" class="title ng-binding"></h1>
<div class="buttons right-buttons"> <span class=""><a href="#/app/home" class="button button-clear"> Home </a></span></div></ion-nav-bar>
<ion-nav-buttons side="right" style="display: none;"></ion-nav-buttons></ng-include>
我可以看到ion-nav-bar設置爲class =不可見,ion-navs-buttons設置爲display:none。
爲什麼會這樣,我能做些什麼來獲得在使用時顯示的導航欄NG-包括哪些內容?
感謝 Meint
是的,這需要參見[angularjs文檔(https://docs.angularjs.org/api/ng/directive/ngInclude)和本[計算器後(HTTP: //stackoverflow.com/questions/13943471/angularjs-ng-include) – Meint 2014-12-15 16:24:31