PrimeNG p-footer 不是 angular 中的已知元素错误 2
PrimeNG p-footer is not a known element error in angular 2
我是 PrimeNG 的新手,我需要一个确认对话框。我阅读了有关确认对话框的文档并在我的组件上实现了它。
我的-component.ts
import { ConfirmDialogModule, ConfirmationService } from 'primeng/primeng';
我的-component.html
<p-confirmDialog header="Order Confirmation" icon="fa fa-question-circle" width="425" #cd>
<p-footer>
<button type="button" pButton icon="fa-close" label="No" (click)="cd.reject()"></button>
<button type="button" pButton icon="fa-check" label="Yes" (click)="cd.accept()"></button>
</p-footer>
</p-confirmDialog>
app.module.ts
import { ConfirmDialogModule, ConfirmationService } from 'primeng/primeng';
@NgModule({
declarations: [
],
imports: [
BrowserModule,
ConfirmDialogModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
AppRoutingModule
],
providers: [ConfirmationService],
bootstrap: [AppComponent]
})
export class AppModule { }
我错过了什么触发了错误?请赐教。
知道了!我只需要导入 SharedModule 即可使用它。
import { ConfirmDialogModule, ConfirmationService, SharedModule } from 'primeng/primeng';
然后将其包含在@NgModule
@NgModule({
declarations: [
],
imports: [
ConfirmDialogModule,
SharedModule
],
providers: [ConfirmationService],
bootstrap: [AppComponent]
})
因为保留了页眉和页脚,PrimeNG 将它们更改为 p-header 和 p-footer,是的,它们在 SharedModule 中。
我是 PrimeNG 的新手,我需要一个确认对话框。我阅读了有关确认对话框的文档并在我的组件上实现了它。
我的-component.ts
import { ConfirmDialogModule, ConfirmationService } from 'primeng/primeng';
我的-component.html
<p-confirmDialog header="Order Confirmation" icon="fa fa-question-circle" width="425" #cd>
<p-footer>
<button type="button" pButton icon="fa-close" label="No" (click)="cd.reject()"></button>
<button type="button" pButton icon="fa-check" label="Yes" (click)="cd.accept()"></button>
</p-footer>
</p-confirmDialog>
app.module.ts
import { ConfirmDialogModule, ConfirmationService } from 'primeng/primeng';
@NgModule({
declarations: [
],
imports: [
BrowserModule,
ConfirmDialogModule,
FormsModule,
ReactiveFormsModule,
HttpModule,
AppRoutingModule
],
providers: [ConfirmationService],
bootstrap: [AppComponent]
})
export class AppModule { }
我错过了什么触发了错误?请赐教。
知道了!我只需要导入 SharedModule 即可使用它。
import { ConfirmDialogModule, ConfirmationService, SharedModule } from 'primeng/primeng';
然后将其包含在@NgModule
@NgModule({
declarations: [
],
imports: [
ConfirmDialogModule,
SharedModule
],
providers: [ConfirmationService],
bootstrap: [AppComponent]
})
因为保留了页眉和页脚,PrimeNG 将它们更改为 p-header 和 p-footer,是的,它们在 SharedModule 中。