Using the default templates provided by Plunker to create angular2 apps, I've been trying to import angular2-moment into my angular2 app on Plunker.
import * as moment from 'moment';
this is how my plunker config.js looks like
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'
}
}
});
What am I missing here?
Try import like below:
Reference: https://github.com/urish/angular2-moment