1
我現在很困惑。試圖顯示這樣一個組件:我的模塊imports
在Angular無法識別選擇器
<popup-standard></popup-standard>
彈出式standard.component.ts
@Component({
selector: "[popup-standard]",
templateUrl: "./standard.template.html"
})
export class PopupStandardComponent { }
popups.module.ts
@NgModule({
declarations: [
PopupStandardComponent,
],
exports: [
PopupStandardComponent
]
})
export class PopupsModule { }
新增PopupsModule:
@NgModule({
imports: [
CommonModule,
ROUTES,
RouterModule,
PopupsModule,
MockModule
],
declarations: [
ChatComponent,
LayoutComponent
],
})
顯示兩個錯誤:
- 如果popup標準是一個Angular組件,那麼驗證它是否是該模塊的一部分。
- 如果popup-standard是一個Web組件,那麼將CUSTOM_ELEMENTS_SCHEMA添加到此組件的@ NgModule.schemas以禁止此消息。
即使我添加架構CUSTOM_ELEMENTS_SCHEMA到我的模塊錯誤消失,但部分是空的,即使有一些HTML代碼等
這裏是軟件包的依賴關係:
"@angular/animations": "^4.2.6",
"@angular/cdk": "^2.0.0-beta.8",
"@angular/common": "^4.0.0",
"@angular/compiler": "^4.0.0",
"@angular/core": "^4.0.0",
"@angular/forms": "^4.0.0",
"@angular/http": "^4.0.0",
"@angular/platform-browser": "^4.0.0",
"@angular/platform-browser-dynamic": "^4.0.0",
"@angular/router": "^4.0.0",
"core-js": "^2.4.1",
"hammerjs": "^2.0.8",
"jquery": "^3.1.0",
"rxjs": "^5.1.0",
"zone.js": "^0.8.4"
我想我正確地做到了這一點,但不知如何。 在此先感謝。
'選擇: 「彈出標準」,' – yurzui