2017-02-09 10 views
0

私はデモアプリケーションを作成していますが、このエラーがあります。私はそれを解決しようとしましたが、できません。私が間違っていることを教えてください。私は角ルータパッケージからのPreloadAllModulesトークンだと思います。エクスポートされたメンバ 'PreLoadAllModules'は、角度2にありますか?

エラーの完全な説明は次のとおりです。

アプリ/アプリ-routing.module.ts(33,15):エラーTS2305:モジュール「"/ホーム/ angular2 /テスト/ node_modules/@角度/ router/index "'には、エクスポートされたメンバー' PreLoadAllModules 'がありません。

は、コードが以下の通りである:

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 {} 

答えて

0

シンプルmispelling、正しいインポートは次のとおりです。

import { PreloadAllModules } from '@angular/router/router'; 
関連する問題