一个可以与 进口{BrowserAnimationsModule}从 '@角/平台的浏览器/动画' 碰到一个问题;
您可以收到此错误信息: node_modules/@角/平台的浏览器/包/平台-BR owser.umd.js/animati组件404(未找到)
为了解决这个问题,如果你正在使用systemjs.config.js,那么你需要有这一行它吧: “@角/平台的浏览器/动画”:“故宫:@角/平台的浏览器/包/平台的浏览器animations.umd的.js',
这里是systemjs.config.js的示例内容可解决该问题:
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': 'node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
app: 'app',
// angular bundles
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/router/upgrade': 'npm:@angular/router/bundles/router-upgrade.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'primeng': 'npm:primeng'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
main: './main.js',
defaultExtension: 'js'
},
rxjs: {
defaultExtension: 'js'
},
primeng: {
defaultExtension: 'js'
}
}
});
})(this);
注:以primeng的参考是没有必要,除非你正在使用它。我碰巧试了一下。 (不推荐)
如果您运行时,单元测试,但没有运行实际的应用程序时得到这个,你需要导入到你的测试平台配置。在另一个问题上看到此答案:https://stackoverflow.com/a/43506088/791007 – Kik