官术网_书友最值得收藏!

URL format

Since I will use a lot of URLs in the following examples, let's quickly look at the URL formats:

  • /inbox/33(popup:compose)
  • /inbox/33;open=true/messages/44

As you can see, the router uses parentheses to serialize secondary segments (for example, popup:compose), the colon syntax to specify the outlet, and the ;parameter=value syntax (for example, open=true) to specify route specific parameters.

In the following examples we assume that we have given the following configuration to the router, and we are navigating to /inbox/33/messages/44:

[
  { path: '', pathMatch: 'full', redirectTo: '/inbox' },
  {
    path: ':folder',
    children: [
      {
        path: '',
        component: ConversationsCmp
      },
      {
        path: ':id',
        component: ConversationCmp,
        children: [
          { path: 'messages', component: MessagesCmp },
          { path: 'messages/:id', component: MessageCmp }
        ]
      }
    ]
  },
  {
    path: 'compose',
    component: ComposeCmp,
    outlet: 'popup'
  },
  {
    path: 'message/:id',
    component: PopupMessageCmp,
    outlet: 'popup'
  }
]
主站蜘蛛池模板: 延吉市| 沁阳市| 奇台县| 营口市| 汶川县| 磴口县| 改则县| 安徽省| 汉中市| 阿城市| 钟祥市| 城固县| 玉田县| 巩义市| 宾川县| 林口县| 湘潭县| 隆回县| 沂南县| 乐昌市| 平阴县| 临朐县| 呼和浩特市| 亚东县| 社旗县| 玉山县| 霍州市| 福海县| 高台县| 韶关市| 邵阳县| 南通市| 泊头市| 宣恩县| 龙游县| 沙湾县| 舞阳县| 乌苏市| 铜鼓县| 金川县| 南皮县|