I am currently incorporating bootstrap
along with angularjs
(and utilizing ui-router
for routing).
Within my navbar
, each tab click should display a nested navbar
within it.
The nested navbar
acts as a ui-view (is there a better way to approach this?).
The issue I am encountering is that when I click on one li in the main navbar, all four nested navbar views are displayed.
div(ng-controller='MyCtrl')
h1 Header
ul.nav.nav-tabs(role="tablist")
li.active(role="presentation")
a(ui-sref='first_nested_state') General
div(ui-view)
li.active.navbar-padding-left(role="presentation")
a(ui-sref='second_nested_state') User
div(ui-view)
li.active.navbar-padding-left(role="presentation")
a(ui-sref='third_nested_state') User
div(ui-view)
li.active.navbar-padding-left(role="presentation")
a(ui-sref='fourth_nested_state') User
div(ui-view)
Here is an example of one nested navbar (all follow the same structure, but differ in names):
div(ui-view)
ul.nav.nav-tabs(role="tablist", color="red")
li.active(role="presentation")
a(ng-href='#') A
li.active(role="presentation")
a(ng-href='#') B
li.active(role="presentation")
a(ng-href='#') C
Below is my state configuration:
$stateProvider
.state('main_nav_bar', {
url: '/main_nav_bar',
templateUrl: 'main_nav_bar.html'
})
.state('first_nested_navbar', {
parent: 'main_nav_bar',
url: '/first_nested_navbar',
templateUrl: 'first_nested_navbar.html'
})
.state('second_nested_navbar', {
parent: 'mainNavBar',
url: '/second_nested_navbar',
templateUrl: 'second_nested_navbar.html'
})
In addition to coffeescript
and jade
, I am using these technologies as well.