0

I am working on an a requirejs + angularjs project with ui-router . I tried to implement nested views but only the state changes but the template URL doesn't load.

My route-config.js

.state(ROUTE.auditGroup, {
  abstract: true,
  authenticate: true,
  data: {
    pageTitle: 'AuditMain'
  },
  views: {
    'user': {
      templateUrl: GLOBAL.viewPath + '/auditgroup.html',
    }
  }
})

.state(ROUTE.audit, {
  url: '/audit',
  authenticate: true,
  data: {
    pageTitle: 'Audit'
  },
  views: {
    'nested': {
      templateUrl: GLOBAL.viewPath + '/audit.html',
      controller: 'auditCtrl',
    }
  },
  ncyBreadcrumb: {
    label: 'Audit',
  }
})

.state(ROUTE.allidentifiers, {
  url: '/allidentifiers',
  authenticate: true,
  data: {
    pageTitle: 'All Identifiers'
  },
  views: {
    'nested': {
      templateUrl: GLOBAL.viewPath + '/audit.allidentifiers.html',
      controller: 'allidentifiersCtrl',
    }
  },
  ncyBreadcrumb: {
    label: 'All Identifiers',
  }
})

My auditgroup.html

<div ui-view="nested"></div>

The Audit Page Works fine but, the allidentifiers page is not injected. Everything works fine except nested views, I could not figure out the exact problem , state changes successfully but the template URL doesn't load. Need assistance.

Plunkr https://embed.plnkr.co/oRMnMW4QoWwhSkm9maHf/

Goto > list>Second Nested

I want to include second nested template in same view

4
  • Put up a fiddle Commented Jan 1, 2017 at 8:06
  • here is the plunk I made plnkr.co/edit/qW5JoXL7nffbbaS1CreZ?p=preview. Goto List and Click second nested button I want the new content insted of the existing list Commented Jan 1, 2017 at 11:39
  • @SamarRizvi.I have attached the plunkr Commented Jan 1, 2017 at 11:46
  • Please see the answer below Commented Jan 2, 2017 at 11:08

1 Answer 1

0

You need to have ui-view for the nested template to show. See the updated plunker here: https://plnkr.co/edit/oRMnMW4QoWwhSkm9maHf?p=preview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.