Skip to content Skip to sidebar Skip to footer

Nested Child State With Ui-router

As I'm working on an Angular app, I was wondering about ui-route nested states. As said in the docu, it's possible to create nested state such as (taken from the doc) : $statePro

Solution 1:

Yes, you can do it like that, as you suggested. EG:

$stateProvider
  .state('contacts', {
    url: '/',
    templateUrl: 'contacts.html',
    controller: function($scope){
       $scope.contacts = [{ name: 'Alice' }, { name: 'Bob' }];
     }
  })
  .state('contacts.list', {
    url: ':list',
    templateUrl: 'contacts-list.html'
  })
  .state('contacts.list.fullDetails', {
    url: '/fullDetails',
    templateUrl: 'contacts-list-full-details.html'
  });

Post a Comment for "Nested Child State With Ui-router"