In Angular ui-router nested state url changes,but template is not loading

前端 未结 6 989
滥情空心
滥情空心 2020-12-08 19:04

I am using ui-router for nested states & views. When I click on the link, the URL changes to the URL for the substate, but the template does not load.

For exampl

6条回答
  •  我在风中等你
    2020-12-08 19:31

    Your nested project.settings state needs to address the view in the higher state explicitly using an '@' suffix, ie.:

    .state('project.settings', {
            url: "/settings",
            views:{
                  "content@":{templateUrl: "partials/project.settings.html"},
                  "header@":{templateUrl: "partials/header"}
            }
     }) 
    

    See more details here https://github.com/angular-ui/ui-router/wiki/Multiple-Named-Views#view-names---relative-vs-absolute-names

提交回复
热议问题