我下面有柱塞代码,此代码用于显示一些子组件:
子组件内的HTML如下所示:
<div>
<h3>I'm the Child component</h3>
</div>
Plnkr代码如下所示:
https://embed.plnkr.co/aYET8s/
但每当我运行柱塞时,我都会收到“正在加载...”文字。
为什么我没有在浏览器中收到“我是儿童组件”?
你能帮忙吗?
答案 0 :(得分:2)
将config.js
更改为使用rxjs@5
和angular/core@5
map: {
'app': './src',
//'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/core': 'npm:@angular/core@5/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/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
'@angular/core/testing': 'npm:@angular/core/bundles/core-testing.umd.js',
'@angular/common/testing': 'npm:@angular/common/bundles/common-testing.umd.js',
'@angular/compiler/testing': 'npm:@angular/compiler/bundles/compiler-testing.umd.js',
'@angular/platform-browser/testing': 'npm:@angular/platform-browser/bundles/platform-browser-testing.umd.js',
'@angular/platform-browser-dynamic/testing': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js',
'@angular/http/testing': 'npm:@angular/http/bundles/http-testing.umd.js',
'@angular/router/testing': 'npm:@angular/router/bundles/router-testing.umd.js',
//'rxjs': 'npm:rxjs',
'rxjs': 'npm:rxjs@5',
'typescript': 'npm:typescript@2.2.1/lib/typescript.js'
},