0
votes

I am trying to implement PrimeNG calendar for date time pricker in my angular 4 application. I did the following installation.

>npm install primeng --save

module.ts

import { Calendar } from 'primeng/primeng'

component.ts

import { Calendar } from 'primeng/primeng'

Component.html

When I run the site, I am getting the following error.

Template pasrse 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 ....

Can you help me out to bring the date time pricker in angular 4 ? Thanks.

1
You just need to import CalendarModule from 'primeng/primeng'; - Parth Savadiya
Thanks man, Its working fine now :) +1 up.. - watraplion

1 Answers

3
votes

In module.ts you additionally have to import your Calendar if it is a Module

@NgModule({
  imports: [
    BrowserModule,
    CalendarModule
],

or to declare it if it is a Component

@NgModule({
  declarations: [
    AppComponent,
    Calendar
],

I guess you didn't do that in either case referring to your post.