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

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'
  }
]
主站蜘蛛池模板: 永善县| 布尔津县| 新建县| 平乐县| 东光县| 龙江县| 峡江县| 吉木萨尔县| 淳安县| 云和县| 柳河县| 翼城县| 瑞昌市| 木兰县| 高安市| 东丰县| 正镶白旗| 岱山县| 辽阳市| 阜新市| 金溪县| 永安市| 永清县| 嘉黎县| 托克托县| 寿阳县| 牡丹江市| 乌兰浩特市| 安龙县| 友谊县| 尼木县| 定远县| 平安县| 威信县| 五台县| 枣庄市| 天气| 大新县| 盖州市| 鱼台县| 柞水县|