I am creating a demo app but got this error.I tried to solve it but can't.Please suggest me what I am doing wrong? I think the PreloadAllModules
token from the Angular router package.
The complete description of error is:
app/app-routing.module.ts(33,15): error TS2305: Module '"/home/angular2/test/node_modules/@angular/router/index"' has no exported member 'PreLoadAllModules'.
The code is given below:
import { RouterModule, Routes ,
Router , ActivatedRoute,
PreLoadAllModules } from '@angular/router';
import { NgModule } from '@angular/core';
import { DashboardComponent } from './dashboard.component';
import { TestComponent } from './test.component';
import { ContactComponent } from './component/contact.component';
import { DirectiveExampleComponent } from './component/directive.exp.component';
import { PowerBoosterComponent } from './component/power-booster.component';
import { PageNotFound } from './component/page.not.found.component';
export const routes: Routes = [
{ path: 'dashboard', component: DashboardComponent },
{ path: 'test', component: TestComponent },
{ path: 'contactus', component: ContactComponent },
{ path: 'directive', component: DirectiveExampleComponent },
{ path: 'pipeexamples', component: PowerBoosterComponent,data:{name:'shubham',id:1} },
{ path: '', redirectTo: '/dashboard', pathMatch: 'full' },
{ path: '**', component: PageNotFound},
];
@NgModule({
imports: [ RouterModule.forRoot(routes,{ preloadingStrategy:PreLoadAllModules }) ],
exports: [ RouterModule ],
})
export class AppRoutingModule {}