html - Include route provider templateurl path in view div Angularjs -


i have below route provider setup like:

$routeprovider .when('/', {     templateurl: '/slapppoc/style library/tac/views/tarification/home.html',     controller: 'homecontroller'          /*     resolve: {         // function called before controller/views instantiated.         'initializeapplication': function (initializationservice) {                             return initializationservice.initializeapplicationdata;         }     }*/ }) .when('/createtarif', {     templateurl: '/slapppoc/style library/tac/views/tarification/createtarif.html',     controller: 'tarificationcontroller'  })  .when('/search', {     templateurl: '/slapppoc/style library/tac/views/tarification/search.html',     controller: 'searchcontroller'  })      .otherwise({ redirectto: '/' }); 

now have div setup in main view -

<div ng-init="tab=1" >         <div class="cb" ng-click="tab = 1">tab 1</div>         <div class="cb" ng-click="tab = 2">tab 2</div>          <div ng-show="tab == 1">                how include html templateurl path here  (createtarif.html)         </div>          <div ng-show="tab == 2">                    how include html templateurl path here  (search.html)         </div> </div> 

edit

i have tried ng-include directive this-

<div ng-include src="'/slapppoc/style library/tac/views/tarification/createtarif.html'"></div> 

but not work also.

so want include html templateurl in subsequent div.how can that? while switching divs html contents auto change.

thanks help.

use ng-include : ( without src )

<div ng-include="'/slapppoc/style library/tac/views/tarification/createtarif.html'" />

instead of

<div ng-include src="'/slapppoc/style library/tac/views/tarification/createtarif.html'"></div>


the example official documentation

<div ng-controller="examplecontroller">     <select ng-model="template" ng-options="t.name t in templates">         <option value="">(blank)</option>     </select>     url of template: <code>{{template.url}}</code>     <hr/>     <div class="slide-animate-container">         <div class="slide-animate" ng-include="template.url"></div>     </div> </div> 

Comments