2017-10-12 2 views
1

각도 4의 게으른 로딩 모듈을 구현했으며 척을 성공적으로 만들 수 있지만 지연된 모듈을 렌더링하려고 할 때 네트워크 및 이미지에서 볼 수있는 것처럼 성공적으로 척을 얻습니다. 아래와 같지만 구성 요소가 렌더링되지 않으며 최악의 경우 각도가 오류를 발생시키지 않습니다.게으른로드 된 구성 요소가 렌더링되지 않음 각도 4

제발 도와주세요 뭔가를 놓치면 도와주세요.

app.routing.ts

const routes: Routes = [ 
    { path: 'career-info', loadChildren: 'app/components/career-info/career-info.module#CareerInfoModule', data: { pageName: 'career-info', screenName: 'experience level', screenCategory: 'choose template', title: 'Career Info - My Perfect Cover Letter', isRegisteredUser: true } }, 
    { path: 'how-it-works', component: HowItWorksComponent, data: { pageName: 'how-it-works', screenName: 'how it works', screenCategory: 'choose template', title: 'How It Works - My Perfect Cover Letter' } }, 
    { path: '**', loadChildren: 'app/components/career-info/career-info.module#CareerInfoModule' } // TODO: give here 404 component 
]; 

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

export class AppRoutingModule { } 
export const RoutingComponents = [HowItWorksComponent] 

덩어리 enter image description here

enter image description here

답변

0

사용 RouterModule.forChild (경로) 네트워크 이 작동.

+0

변경 후 "처리되지 않은 약속 준수 거부 : 라우터 공급자가 없습니다 : 영역 : , 작업 : Promise.then, 값 : 오류 : 라우터 공급자 없음!"오류가 발생합니다. –

+0

이것이 대답인지 여부는 모르지만 지연로드 된 모듈의 경로는 const 라우트와 유사해야합니다. Routes = [ { 경로 : '', 어린이 : [ {경로 : '', 구성 요소 : CareerInfoComponent} , {경로 : 'career-info', 구성 요소 : CareerInfoComponent} ] }, ]; 그것은 나를 위해 일하고 있습니다. –