2017-01-11 5 views
0

私のAnger 2アプリでng2-bootstrap datePickerを実装していますが、いくつかのタイプのモジュールに直面していますが、何が問題なのか理解できません。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"-"): [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

、このDatepickerModuleを試してみてください。 forRoot()