角延迟加载不接受多个子路径来进行参数化

时间:2019-08-02 12:15:10

标签: angular ionic-framework angular-ui-router

我正在设计一个基本的离子应用程序,我的应用程序具有多个具有延迟加载功能的子组件。问题是,当多个子路由在URL中具有参数时,表示它没有对它进行路由。

如果我有一条带有param的路线,则表明它工作正常。

import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { PlacesPage } from './places.page';

const routes: Routes = [
    {
      path: 'tabs',
      component: PlacesPage,
      children: [
        {
        path: 'discover',
        children: [
        {
            path: '',
            loadChildren: './discover/discover.module#DiscoverPageModule'
        },
        {
            path: ':placeId',
            loadChildren: './discover/place-detail/place-detail.module#PlaceDetailPageModule'
        }

        ]
    },
    {
        path: 'offer',
        children: [
            {
                path: 'edit/:placeId',
                loadChildren:
                  './offer/edit-offer/edit-offer.module#EditOfferPageModule'
              }
            ,
            {
                path: '',
                loadChildren: './offer/offer.module#OfferPageModule'
            },
            {
                path: ':placeId',
                loadChildren: './offer/offer-bookings/offer-bookings.module#OfferBookingsPageModule'
            },

            {
                path: 'new',
                loadChildren: './offer/new-offer/new-offer.module#NewOfferPageModule'
            }
        ]

    },
    {
        path: '',
        redirectTo: '/places/tabs/discover',
        pathMatch: 'full'
    }

      ]
    },
    {
        path: '',
        redirectTo: '/places/tabs/discover',
        pathMatch: 'full'
    }
  ];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})

export class PlacesRoutingModule {}

错误错误:未捕获(承诺):TypeError:无法读取null的属性“出口” TypeError:无法读取null的属性“插座”     在createNewSegmentGroup

0 个答案:

没有答案