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

一曲冷凌霜 提交于 2019-12-01 20:37:06
Radim Köhler

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:

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!