새로운 라우터 (3.0.0)의 종류 RouterConfig
배열 인수를 취하는 provideRouter
기능을 제공 bootsrapped 아니다. 예 :ANGULAR2 노선</p> <p>공식 개발자 가이드는 <code>const</code> 부트 스트랩에 의해 가이드를 제공 ...
export const APP_ROUTER_PROVIDERS = [ provideRouter(routes) ];
난 그냥 부트 스트랩 파일
...
import {APP_ROUTER} from './app/app.routes';
...
bootstrap(AppComponent, [HTTP_PROVIDERS, APP_ROUTER, ...]);
-->
app.route.ts
에게 class
-->
client.ts
로 라우팅 파일을 부트 스트랩 할
import {Injectable} from '@angular/core';
import { provideRouter, RouterConfig } from '@angular/router';
import { somecomponents };
@Injectable()
export class APP_ROUTER {
constructor(
RouterConfig: RouterConfig
) {
this.ROUTE_prov = [provideRouter(this.prov)];
}
public ROUTE_prov;
public prov : RouterConfig = [
{ path: '/', component: HomePageComponent },
{ path: 'home', component: HomePageComponent },
{ path: 'about', component: AboutPageComponent },
{ path: 'landing', component: LandingPageComponent },
{ path: 'pp/:nickName', component: PersonalPageComponent },
{ path: 'carlos', component: CarlosPageComponent },
{ path: '**', redirectTo: 'home' }
];
}
그리고 난이 오류가 ... 라우트는로드되지 않습니다 : 귀하의 의견이 시도 다음
내가 말하듯이 :'그냥 클래스로''const' 나'var'가 아닌 부트 스트랩하고 싶습니다. –