저는 Angular2에서 새로 생겼습니다. 오류에 thisAngular2 - 'UIRouterModule'함수를 호출 할 때 함수 호출이 지원되지 않습니다.
오류를 참조
이 오류 나는
UIRouterModule
을 가져올 때 내가 갖는은 정적 심볼 값을 해결 발생했습니다. 함수 'UIRouterModule'을 호출하면 함수 호출이 지원되지 않습니다. 함수 또는 람다를 /site_root/src/app/app.module.ts에서 AppModule 심볼을 해석하고 /site_root/src/app/app.module.ts에있는 AppModule을 해석하여 내 보낸 함수에 대한 참조로 대체하는 것을 고려하십시오.
어디 내가 잘못
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule } from '@angular/http';
import { RouterModule, Routes } from '@angular/router';
import { UIView, UIRouterModule } from "ui-router-ng2";
import { AppComponent } from './app.component';
import { ProfileComponent } from './profile/profile.component';
import { WidgetComponent } from './widget/widget.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { MyRootUIRouterConfig } from "./router.config";
import {MAIN_STATES} from "./app.states";
const appRoutes: Routes = [
{ path: '', component: DashboardComponent },
{ path: 'profile', component: ProfileComponent },
{ path: 'widget', component: WidgetComponent },
];
@NgModule({
declarations: [
AppComponent,
ProfileComponent,
WidgetComponent,
DashboardComponent
],
imports: [
BrowserModule,
FormsModule,
HttpModule,
RouterModule.forRoot(appRoutes),
UIRouterModule.forRoot({
states: MAIN_STATES,
otherwise: { state: 'app', params: {} },
useHash: true,
configClass: MyRootUIRouterConfig
})
],
providers: [],
bootstrap: [AppComponent, UIView]
})
export class AppModule { }
, app.module.ts
을 내?
여전히 같은 오류가 발생합니다. –
이 빠른 시작을 참조하겠습니다. - https://github.com/ui-router/quickstart-ng2/tree/master –