In order to get what you are expecting you need to write your layout better.
You layout is currently:
<div>
.. some layout code here
<div> navigation here </div>
<div ui-view></div>
..some more layout
</div>
in order to get the result you want you have use nested ui-views
<div>
.. outer layout
<div ui-view>
.. inner layout
<div> navigation here </div>
<div ui-view></div>
.. inner layout cont.
</div>
.. outer layout cont.
</div>
and change the routing accordingly.
if you give me a couple of minutes I will prepare a plunkr for you.
So this is a plunker for you:
http://plnkr.co/edit/Y6PqRhrbvpEpWApm9lkS?p=preview
and this is the breakdown of the code I did
$stateProvider
.state('layout', {
template: 'my navigation <div ui-view></div>'
} )
.state('layout.page', {
url: '/page',
template: 'this is my content go see a missing page <a href="#/404">missing page link</a>'
})
.state('404', {
url:'/404',
template: '404!!! page is missing'
});
As you can see I have an "abstract" state called "layout", which basically defines template but that's it! no url, no controller no nothing.
I add the navigation in the template, and then another ui-view. - NOTE I already have a ui-view on my index.html. other than that that index.html can be empty as far as I care. I added hello there just so you have a point of reference.
then my page is a nested state inside layout. see state layout.page. This is what is so great in angular-ui-router.
This way you can have different layouts for different sections of the website.
So my page uses the layout simply by nesting the state.
then I have a different state which I called 404.
Since it does not inherit from layout, it will not have the navigation.