即使在导入CalendarModule之后,在angular2中使用p-calendar时,我也遇到了错误。
从“ ../../../vendor/primeng/components/calendar/calendar”中导入{CalendarModule};
Uncaught Error: Template parse errors:
'p-calendar' is not a known element:
1. If 'p-calendar' is an Angular component, then verify that it is part of this module.
2. If 'p-calendar' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<div>
Calendar
[ERROR ->]<p-calendar [(ngModel)]="todaysDate"></p-calendar>
</div>
答案 0 :(得分:0)
好像您错过了在应用程序中导入CalenderModule
一样。您必须从CalendarModule
库中将AppModule
内的primeng
导入imports
的{{1}}中。
AppModule