watraplion
watraplion

Reputation: 287

PrimeNG calendar error - Angular 4

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.

Upvotes: 0

Views: 1476

Answers (1)

user6749601
user6749601

Reputation:

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.

Upvotes: 3

Related Questions