0
角度2のアプリケーションでng2-paginate
のページングを実装しようとしています。TypeError:オブジェクトはプロパティまたはメソッド 'map'をサポートしていません。ng2-paginate
私はhttps://github.com/michaelbromley/ng2-paginationリンクをたどって、次のsystem.config.jsになってしまっています
System.config.js:
/**
* System configuration for Angular 2 samples
* Adjust as necessary for your application needs.
*/
(function(global) {
// map tells the System loader where to look for things
var map = {
'app': '/app', // 'dist',
'@angular': '/node_modules/@angular',
'angular2-in-memory-web-api': '/node_modules/angular2-in-memory-web-api',
'rxjs': '/node_modules/rxjs',
'ng2-pagination': '/node_modules/ng2-pagination/dist'
};
// packages tells the System loader how to load when no filename and/or no extension
var packages = {
'app': { main: 'main.js', defaultExtension: 'js' },
'rxjs': { defaultExtension: 'js' },
'angular2-in-memory-web-api': { main: 'index.js', defaultExtension: 'js' },
'ng2-pagination': { main: 'ng2-pagination.js', defaultExtension: 'js' }
};
var ngPackageNames = [
'common',
'compiler',
'core',
'forms',
'http',
'platform-browser',
'platform-browser-dynamic',
'router',
'router-deprecated',
'upgrade',
];
// Individual files (~300 requests):
function packIndex(pkgName) {
packages['@angular/'+pkgName] = { main: 'index.js', defaultExtension: 'js' };
}
// Bundled (~40 requests):
function packUmd(pkgName) {
packages['@angular/'+pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' };
}
// Most environments should use UMD; some (Karma) need the individual index files
var setPackageConfig = System.packageWithIndex ? packIndex : packUmd;
// Add package entries for angular packages
ngPackageNames.forEach(setPackageConfig);
// No umd for router yet
packages['@angular/router'] = { main: 'index.js', defaultExtension: 'js' };
var config = {
map: map,
packages: packages
};
System.config(config);
})(this);
これは、エラー・スタックです:
Error: TypeError: Object doesn't support property or method 'map'
at ReflectionCapabilities.prototype.parameters (eval code:5006:17)
at Reflector.prototype.parameters (eval code:5191:17)
at CompileMetadataResolver.prototype.getDependenciesMetadata (eval code:13459:13)
at CompileMetadataResolver.prototype.getTypeMetadata (eval code:13420:13)
at CompileMetadataResolver.prototype.getPipeMetadata (eval code:13447:17)
at Anonymous function (eval code:13246:30)
at CompileMetadataResolver.prototype.getNgModuleMetadata (eval code:13236:21)
at Anonymous function (eval code:13228:29)
at CompileMetadataResolver.prototype.getNgModuleMetadata (eval code:13215:21)
at RuntimeCompiler.prototype._compileComponents (eval code:15845:13)
Evaluating http://localhost:53869/app/main.js
Error loading http://localhost:53869/app/main.js
Package.json
もng2-paginate
のエントリを依存関係として示しています。
誰かがこのエラーが発生した理由を説明することはできますか。前もって感謝します。