AngularJS Router Nested views with Nested states
In this Post We Will Explain About is AngularJS Router Nested views with Nested states With Example and Demo.Welcome on infinityknow.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to AngularJS Nested views with Nested states using RoutingExample
In this post we will show you Best way to implement angularjs – ui router – nested views with shared controller, hear for Creating Nested States with AngularJS UI Routerwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.
Make a HTML file and define markup
[php]
http://jquery.js
http://angular.min.js
http://angular-ui-router.min.js
http://ui-bootstrap-tpls.min.js
http://bootstrap.min.js
home
create new second_level
- second_level 1
- second_level 2
- second_level 3
create new first_level
- first_level 1
- first_level 2
- first_level 3
[/php]
Make a js file and define scripting
[php]
var liveApp = angular.module(‘liveApp’, [‘ui.router’]);
liveApp.config(function ($stateProvider, $urlRouterProvider) {
$urlRouterProvider.otherwise(“/index”);
$stateProvider
// index
.state(‘index’, {
url: “/index”,
views: {
‘menu-view’: {
templateUrl:”menu.html”
},
‘container-view’: {
templateUrl:”home.html”
},
‘left-view@index’ :{
templateUrl:”second_level.html”
},
‘right-view@index’ :{
templateUrl:”first_levels.html”
},
‘status-view’: {
template:”
index
”
},
},
})
// second_level
.state(‘second_level’, {
url: “/second_level”,
views: {
‘menu-view’: {
templateUrl:”menu.html”
},
‘container-view’: {
templateUrl:”second_level.html”
},
‘status-view’: {
template:”
second_level
”
},
},
})
// second_level, create substate
.state(‘second_level.create’, {
url: “/create”,
views: {
‘bottom-view@second_level’: {
templateUrl:”second_level.create.html”
},
‘status-view@’: {
template:”
second_level.create
”
},
},
})
// second_level, list substate
.state(‘second_level.list’, {
url: “/list”,
views: {
‘bottom-view@second_level’: {
templateUrl:”second_level.list.html”
},
‘status-view@’: {
template:”
second_level.list
”
},
},
})
// first_levels
.state(‘first_levels’, {
url: “/first_levels”,
views: {
‘menu-view’: {
templateUrl:”menu.html”
},
‘container-view’: {
templateUrl:”first_levels.html”
},
‘status-view’: {
template:”
first_levels
”
},
},
})
// first_levels, create substate
.state(‘first_levels.create’, {
url: “/create”,
views: {
‘bottom-view@first_levels’: {
templateUrl:”first_levels.create.html”
},
‘status-view@’: {
template:”
first_levels.create
”
},
},
})
// first_levels, list substate
.state(‘first_levels.list’, {
url: “/list”,
views: {
‘bottom-view@first_levels’: {
templateUrl:”first_levels.list.html”
},
‘status-view@’: {
template:”
first_levels.list
”
},
},
})
});
[/php]
I hope you have Got What is AngularJS UI-Router Nested Views And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.