0

It doesn't work with the last one where there are three states. How do I make it work?

There is no error. The page itself doesn't load (It`s like I press link and nothing changes (except url in browser address line) )

.state('parent', {
            url: '/home',
            abstract: true,
            template: '<ui-view/>'
        })
        .state('parent.index', {
            url: '/index',
            template: '<h1>test1</h1>'
        })
        .state('parent.contact', {
            url: '/contact',
            template: '<h1>test2</h1>'
        })
        .state('parent.contact.test', {
            url: '/test',
            template: '<h1>test3</h1>'
        })
AncientSwordRage
  • 7,086
  • 19
  • 90
  • 173

1 Answers1

0

Try for this, To be short, contact states are children of parentstate, so they can't have access of Test view, because it's related to test state.

So you need to write :

.state('parent.contact.test', {
  url: "/test",
  views: {
    'Test@test' :{
      templateUrl: "test.html"
    }
  }
})
Kunvar Singh
  • 1,779
  • 2
  • 13
  • 21