无法绑定到' pickerType'因为它不是'owl-date-time'的已知属性。

时间:2018-03-30 18:12:32

标签: angular datepicker calendar property-binding

owl-date-time pickerType属性不适用于Angular 4。

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

无法绑定到&#39; pickerType&#39;因为它不是'owl-date-time&#39;的已知属性。

npm:ng-pick-datetime-highlight

无法导入模块OwlDateTimeModule

1 个答案:

答案 0 :(得分:2)

您必须将OwlDateTimeModule和OwlNativeDateTimeModule添加到@NgModule中,如下所示:

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 {}

见这里:

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