Plunker将angular2-moment包添加到angular2应用程序

问题描述:

使用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};:

尝试导入像下面

看看这个链接: https://github.com/urish/angular2-moment