2016-12-30 72 views
0

使用Plunker提供的默認模板創建angular2應用程序,我一直試圖將angular2-moment導入Plunker的angular2應用程序。Plunker將angular2-moment包添加到angular2應用程序

import * as moment from 'moment'; 

這是我plunker config.js看起來像

System.config({ 
    //use typescript for compilation 
    transpiler: 'typescript', 
    //typescript compiler options 
    typescriptOptions: { 
    emitDecoratorMetadata: true 
    }, 
    paths: { 
    'npm:': 'https://npmcdn.com/' 
    }, 
    //map tells the System loader where to look for things 
    map: {  
    'app': './src', 
    ....other angular2 packages work fine... 
    'rxjs': 'npm:rxjs', 
    'moment': 'npm:[email protected]', 
    'angular2-moment': 'npm:[email protected]', 
    'typescript': 'npm:[email protected]/lib/typescript.js' 
    }, 
    //packages defines our app package 
    packages: { 
    'app': { 
     main: './main.ts', 
     defaultExtension: 'ts' 
    }, 
    'rxjs': { 
     defaultExtension: 'js' 
    }, 
    'angular2-moment': { 
     defaultExtension: 'js' 
    } 
    } 
}); 

缺少什麼我在這裏?從 'angular2矩'

進口{MomentModule};:

回答