У меня, похоже, проблема с новым маршрутизатором Angular 2 3.0.0-alpha.8.Угловой 2 Router 3.0.0 Вложенные маршруты Компиляция
Короче говоря, мой app.routes.ts является
export const routes: RouterConfig = [
{ path: '', component: HomeComponent, canActivate: [AuthGuard] },
{ path: 'login', component: LoginComponent },
...SectionARoutes,
...SectionBRoutes
];
export const APP_ROUTER_PROVIDERS = [
provideRouter(routes),
AUTH_PROVIDERS
];
Он загружает раздел А маршрут просто отлично, который:
export const SectionARoutes: RouterConfig = [
{ path: 'a', component: SectionAComponent, canActivate: [AuthGuard] },
{ path: 'a-more', component: SectionAMoreComponent, canActivate: [AuthGuard] },
...SectionAMoreRoutes
];
Но это не удается загрузить вложенные SectionAMoreRoutes. Когда я говорю, что не сработал, я имею в виду ошибки, я получаю:
zone.js:463 Error: Uncaught (in promise): Error: Error: XHR error (404 Not Found)
loading http://localhost:4200/app/+a/+a-more/a-more.routes.ts.js(…)
Оказывается, что моя машинопись не получает скомпилирована в JS, когда маршрут вложенная. Я хотел бы любую помощь или идеи о том, как действовать, потому что я довольно потерял :(
Спасибо !!!
EXTRA INFO: Мои main.ts имеет:
bootstrap(AppComponent, [
...
APP_ROUTER_PROVIDERS,
]
Section- А'море маршрут выглядит следующим образом:
export const SectionARoutes: RouterConfig = [
{ path: '', component: SectionAMoreListComponent, canActivate: [AuthGuard] },
{ path: '/:id', component: SectionAMoreDetailComponent, canActivate: [AuthGuard] }
];
TLDR: Почему мои вложенные маршруты не компилируется в угловых 2 и маршрутизатора 3.0.0
что у вас есть в качестве базы href в index.html? –