您好,我尝试获取“以在屏幕和控制台终端上显示我的文本。我什么也没收到,您什么也听不到。我不明白我在做什么错。
我已经尝试了我在互联网上研究过的所有内容。没用
app.component.html
<bootstrap-panel>
<div heading>Header</div>
<div body></div>
</bootstrap-panel>
panel.component.html
<div class="panel panel-default">
<div class="panel-heading">
<ng-content select="[heading]"></ng-content>
</div>
<div class="panel-body">
<div class="body">
<h2>Body</h2>
<p>Some Content here.....</p>
</div>
</div>
</div>
终端中不显示任何内容。我在app.component.html中看不到我的“ ng-content”,而在那之后我只能看到panel.component.html。
显示的唯一原因是因为我实际上已将其输入到panel.component.html中。
package.json
{
"name": "hello-world",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "~8.0.3",
"@angular/common": "~8.0.3",
"@angular/compiler": "~8.0.3",
"@angular/core": "~8.0.3",
"@angular/forms": "~8.0.3",
"@angular/platform-browser": "~8.0.3",
"@angular/platform-browser-dynamic": "~8.0.3",
"@angular/router": "~8.0.3",
"@fortawesome/angular-fontawesome": "^0.4.0",
"@fortawesome/fontawesome-svg-core": "^1.2.19",
"@fortawesome/free-regular-svg-icons": "^5.9.0",
"@fortawesome/free-solid-svg-icons": "^5.9.0",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^3.3.7",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.6",
"@angular/cli": "~8.0.6",
"@angular/compiler-cli": "~8.0.3",
"@angular/language-service": "~8.0.3",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
}
}
我希望它能在屏幕上显示而不会出现任何问题。有人可以看看这是怎么回事。任何帮助将不胜感激。