How to send object from 1 $state into another $state with ui-router

后端 未结 2 2004
不思量自难忘°
不思量自难忘° 2021-01-20 05:29

https://plnkr.co/edit/nqyBTcBgBimjkrpf2oYo?p=preview

Expected

After Login Selecting a Ticker button should make the Tags module display the matc

相关标签:
2条回答
  • 2021-01-20 05:59

    There is the updated plunker

    Namely we have to set a tags state as a child of container one

      const tags = {
        // here we use parent as a placeholder for our child state
        parent: 'container',
        name: 'tags',
        url: '/tags',
    

    also, the container state now in template has a target

    <div ui-view>
    </div>
    

    And finally - tags stat has as a part of its template the tags-module

    template: '<p>Tags State</p><tags-module></tags-module>',
    

    Check it here and also to get more understanding about nesting, maybe check this:

    • Nested states or views for layout with leftbar in ui-router?
    0 讨论(0)
  • 2021-01-20 06:05

    You need to have all route configs in one module, else the different routes (states) won't know about eachother.

    You should check out how to do nested views/states: https://github.com/angular-ui/ui-router/wiki/Nested-States-&-Nested-Views

    0 讨论(0)
提交回复
热议问题