Answer the question
In order to leave comments, you need to log in
How to load different templates in one view using ui-router?
Hello gentlemen.
Let's say there is a navigation block: <div ui-view="mainNavView"></div>
When changing urls, you need to load different templates into it:
$stateProvider
.state('notes', {
url: "/notes",
views:{
'mainNavView' : {
templateUrl: '/partials/notesGroups.html',
controller: 'mainNavCtrl',
}
}
})
.state('notes.list',{
url:'/list/{id}',
views:{
'mainNavView' : {
templateUrl: '/partials/notesList.html',
controller: 'mainNavCtrl',
}
}
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question