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

  • Angular Router
  • Victor Savkin
  • 139字
  • 2021-07-09 19:20:31

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'
  }
]
主站蜘蛛池模板: 靖边县| 常州市| 冕宁县| 顺义区| 柘城县| 威远县| 鱼台县| 灵丘县| 普兰县| 信丰县| 湾仔区| 韶关市| 铁岭县| 津市市| 房产| 彝良县| 松阳县| 察隅县| 固阳县| 徐州市| 永丰县| 祁东县| 抚远县| 昌乐县| 襄樊市| 天全县| 腾冲县| 凤冈县| 正宁县| 迭部县| 靖边县| 偃师市| 富阳市| 高密市| 大悟县| 孙吴县| 萨嘎县| 涞水县| 乌兰县| 甘谷县| 海兴县|