angularjs - Common html file should be included in index.html -


i have angularjs web app multiple views , controllers.i have html file named topnav.html included in views except 3.instead of including in views , want include in index.html . in views if that. have exclude 3 specific views. how do that?

div class="container p-t-md" > <div ng-include="'views/topnav.html'"></div> <div class="row">     <div ng-include="'views/leftpanel.html'"></div> 

i include topnav.html in views except 3. instead want include in index.html .but problem i'm getting topnav.html in views including 3 views .but, don't want topnav.html included in 3 of views. know have use ng-if don't know put in it.

you use ng-if accomplish excluding reference on specific page. need provide better example of trying do.

create variable persists through of pages so:

//make universal variable $scope.includejs = true;   //put either in js of page want not have reference or put in universal js , put $watch on it. if($location.path() == "/excludepath") {     //if in universal js    $scope.includejs = false;     // if in js file outside universal js    $scope.$parent.universalctrl.includejs = false; } 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -