私はAngular2で新しくなりました。エラーにthisAngular2 - 関数 'UIRouterModule'を呼び出すと、関数呼び出しはサポートされません。
ERRORを参照
このエラー私は
UIRouterModule
をインポートするとき、私は取得していますが、静的シンボル値を解決遭遇しました。関数 'UIRouterModule'を呼び出すと、関数呼び出しはサポートされません。関数またはラムダを、/site_root/src/app/app.module.ts内のAppModuleシンボルを解決し、/site_root/src/app/app.module.tsのAppModuleシンボルを解決して、エクスポートされた関数への参照で置き換えることを検討してください。
私app.module.ts
は、私が間違ってやっている
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 { }
のですか?
まだ同じエラーが発生しています。 –
私はこのクイックスタートを参照しています - https://github.com/ui-router/quickstart-ng2/tree/master –