【发布时间】:2017-05-26 00:37:26
【问题描述】:
我正在实现 ng2-bootstrap 日期选择器,但出现以下错误。请帮助我。
EXCEPTION: Uncaught (in promise): Error: Error in
http://localhost:8888/app/components/report.component.html:3:0 caused by: No provider for DatepickerConfig!
module.ts
import { DatepickerModule } from 'ng2-bootstrap';
@NgModule({
imports: [DatepickerModule],
declarations: [],
providers: [],
bootstrap: [AppComponent]
})
component.ts
@Component({
module: module.id,
selector:'my-date',
template: `
<h4>My Date Picker</h4>
<datepicker></datepicker>`
})
export class MyComponent {
}
systemjs.config.js
System.config({ map: { 'ng2-bootstrap':
'npm:ng2-bootstrap/bundles/ng2-bootstrap.umd.js'} })
【问题讨论】:
-
问题解决了吗?
标签: angular ng2-bootstrap ng2-datepicker