angularjs - show stateprovider template with ng-view -


how can include view in <ng view></ng-view>, have multiple template, cant include 1 using ng-include src="" shows content in different link, not using ng-view

 <ul class="nav">         <li><a href="#/inventory/list">list view</a></li>     </ul> <ng-view></ng-view>  

my stateprovider

app.config(function config( $stateprovider) {   $stateprovider.state('inventory',{     url:'/inventory',         views: {             "main": {                 controller: 'inventoryctrl',                 templateurl: 'inventory/main.tpl.html'             }         },         data:{ pagetitle: 'inventory' }   }   ).state('add',{     url:'/inventory/list',         views: {             "main": {                 controller: 'inventoryctrl',                 templateurl: 'inventory/list.tpl.html'             }         },         data:{ pagetitle: 'list field' }   }); }); 

angularjs standard $route , $routeprovider incompatible ui-router $state , $stateprovider.

use ui-view , go though ui-router docs https://github.com/angular-ui/ui-router/wiki


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -