Can't bind to 'pickerType' since it isn't a known property of 'owl-date-time'

最后都变了- 提交于 2019-12-11 05:24:29

问题


owl-date-time pickerType property is not not working with Angular 4.

<owl-date-time [pickerType]="'timer'" [(ngModel)]="selectedStartDate" [min]="minDate">

Can't bind to 'pickerType' since it isn't a known property of 'owl-date-time'.

npm: ng-pick-datetime-highlight

Unable to import modules OwlDateTimeModule


回答1:


You have to add OwlDateTimeModule and OwlNativeDateTimeModule to your @NgModule like this:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { MyTestApp } from './my-test-app';

import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';

@NgModule({
 imports: [ 
     BrowserModule, 
     OwlDateTimeModule, 
     OwlNativeDateTimeModule,
 ],
 declarations: [ MyTestApp ],
 bootstrap:    [ MyTestApp ]
})
export class MyTestAppModule {}

see here:

https://www.npmjs.com/package/ng-pick-datetime



来源:https://stackoverflow.com/questions/49579333/cant-bind-to-pickertype-since-it-isnt-a-known-property-of-owl-date-time

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!