ng2-bootstrap datepicker错误

时间:2017-01-11 05:29:10

标签: ng2-bootstrap ng2-datepicker

我正在我的angular 2应用程序中实现ng2-bootstrap datePicker,但遇到某种类型的模块错误,我不明白背后的问题是什么。请帮助我。

module.ts

import { DatepickerModule } from 'ng2-bootstrap/datepicker';
@NgModule({
 imports: [
 ...........  
 DatepickerModule
 ...........
 ],
 declarations: [
 .....
 .....
]})

export class Modules {
 }

HTML

<datepicker></datepicker>

错误

 'datepicker' is not a known element:
    1. If 'datepicker' is an Angular component, then verify that it is part of this module.
    2. If 'datepicker' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schema' of this component to suppress this message. ("<div class="form-group"><div>
                          [ERROR ->]<datepicker></datepicker>
                          <!--<datepicker [expanded]="true" class="danger"-"): AddCustomer@49:26
    Can't bind to 'expanded' since it isn't a known property of 'datepicker'. ("                              <div>
                                                    <datepicker [ERROR ->][expanded]="true" class="danger"
                                                                form"): AddCustomer@212:64
    'datepicker' is not a known element:

1 个答案:

答案 0 :(得分:0)

在导入中,尝试使用此DatepickerModule.forRoot()