2016-12-28 96 views
0

我在我的角2應用程序中實現ng2-bootstrap datePicker,但遇到某種類型的模塊錯誤,我不明白背後的問題是什麼。請幫助我。ng2-boostrap datePicker執行錯誤

module.ts

import { DatepickerModule } from 'ng2-bootstrap/datepicker'; 

@NgModule({ 
    imports: [ 
    ........... 
    DatepickerModule 
    ........... 
    ], 
    declarations: [ 
    ..... 
    ..... 
    ] 
}) 
export default class Modules { 
} 

HTML文件

<div> 
    <datepicker></datepicker> 
</div> 

錯誤

'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"-"): [email protected]:26 
Can't bind to 'expanded' since it isn't a known property of 'datepicker'. ("        <div> 
                <datepicker [ERROR ->][expanded]="true" class="danger" 
                   form"): [email protected]:64 
'datepicker' is not a known element: 
+0

您的'AddCustomer' TS文件? –

回答

0

有你在你的應用程序包括。 module.ts Boostrap的lib?像這樣:

​​