I am getting this error when I load the application. I have referred the
router references : 3.0.0-beta.1 My menu router provider component
import { provideRouter, RouterConfig } from '@angular/router';
import { AboutComponent} from './About';
import { AboutHomeComponent } from './AboutHome';
import { AboutItemComponent } from './AboutItem';
import { HomeComponent } from './Home';
export const routes: RouterConfig = [
{ path: '', component: HomeComponent },
{
path: 'about',
component: AboutComponent,
children: [
{ path: '', component: AboutHomeComponent },
{ path: 'item/:id', component: AboutItemComponent }
]
}
];
export const APP_ROUTER_PROVIDERS = [
provideRouter(routes)
];
My package.json is
{
"name": "Firebolkt",
"version": "1.0.0",
"dependencies": {
"@angular/common": "2.0.0-rc.4",
"@angular/compiler": "2.0.0-rc.4",
"@angular/core": "2.0.0-rc.4",
"@angular/http": "2.0.0-rc.4",
"@angular/platform-browser": "2.0.0-rc.4",
"@angular/platform-browser-dynamic": "2.0.0-rc.4",
"@angular/router": "3.0.0-beta.1",
"@angular/router-deprecated": "2.0.0-rc.2",
"@angular/upgrade": "2.0.0-rc.1",
"@angular/forms": "0.2.0",
"systemjs": "0.19.27",
"core-js": "^2.4.0",
"reflect-metadata": "^0.1.3",
"rxjs": "5.0.0-beta.6",
"zone.js": "^0.6.12",
"bootstrap": "^3.3.6"
},
"devDependencies": {
"gulp": "^3.9.1",
"q": "^1.4.1",
"rimraf": "^2.5.2"
}
}
I am getting the error in the browser console on the loading of the
application
index.html:16 Error: TypeError: router_1.provideRouter is not a function
at Object.eval (http://localhost:49928/app/Menu/MenuProviders.js:19:14)
at eval (http://localhost:49928/app/Menu/MenuProviders.js:22:4)
at eval (http://localhost:49928/app/Menu/MenuProviders.js:23:3)
at Object.eval (http://localhost:49928/app/main.js:8:25)
Evaluating http://localhost:49928/app/Menu/MenuProviders.js
Evaluating http://localhost:49928/app/main.js
Error loading http://localhost:49928/app/main.js
I even tried clearing the node_modules and wwwroot/lib folders and executed
again, still I am getting the same error. any ideas why I am getting this
error?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.