2
ui-routerをに統合する方法4。例を考えるともあり、最新バージョン(https://ui-router.github.io/ng2/)角4 - UIルーター
package.json
"dependencies": {
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"rxjs": "^5.1.0",
"ui-router-ng2": "^1.0.0-beta.1",
"zone.js": "^0.8.4"
}
アプリ-routing.module.ts
import { NgModule } from '@angular/core';
import { RouterModule } from '@angular/router'
import { DashboardComponent } from './components/dashboard/dashboard.component';
import { UsersComponent } from './components/users/users.component';
/** Routing with ui-router */
import { UIRouter } from "ui-router-ng2";
let helloState = { name: 'dashboard', url: '/dashboard', component: DashboardComponent };
let aboutState = { name: 'users', url: '/users', component: UsersComponent };
@NgModule({
imports: [
UIRouter.forRoot({ states: [helloState, aboutState] })
],
exports: [
RouterModule
]
})
export class AppRoutingModule { }
で動作しているようだしません'UIRouter.forRoot'のエラー(forRootプロパティは存在しません)。どんな助けか例?