Ngx-bootstrap: BsDatepicker doesn't show up in Children Components (ngx-bootstrap)

Created on 27 Feb 2018  路  2Comments  路  Source: valor-software/ngx-bootstrap

I'm working with Angular 5 and I want to use ngx-bootstrap bsDatepicker module. I followed steps from https://ngx-universal.herokuapp.com/datepicker but datepicker doesn't show up. I just get console warning message. I don't get any error message

warn-once.js:10

BsDatepickerModule is under development,

BREAKING CHANGES are possible,

PLEASE, read changelog

Datepicker element also not rendered: https://i.stack.imgur.com/eiZQm.png

my app.module.ts:
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker'; ... imports: [ ... , BsDatepickerModule.forRoot(), ... , ],

my custom.component.html:
<div class="col-md-6">
<input type="text" class="form-control" placeholder="Datepicker" bsDatepicker formControlName="date" />
</div>

I also added CDN link of bsDatepicker.css file to my index.html:
<link rel="stylesheet" href="https://unpkg.com/ngx-bootstrap/datepicker/bs-datepicker.css">

Versions of ngx-bootstrap, Angular, and Bootstrap:

ngx-bootstrap: ^2.0.2

Angular: 5.1.3

Bootstrap: 3.3.7

Build system:

Angular CLI: 1.6.3,
webpack: 3.10.0,
typescript: 2.4.2

can be closed? comp(datepicker) reproduce

Most helpful comment

@IlyaSurmay man real problem is it doesn't work in children components which loaded with lazyLoading. If I add BsDatepickerModule.forRoot() to app.module.ts, It just shows app.component.html.

If I want to use this my children components, I have to add BsDatepickerModule.forRoot() to childModule which I want to use.

But ex: ModalModule.forRoots() works perfectly fine in children compontents If I just add ModalModule.forRoot() to app.module.ts :(

All 2 comments

There's no need to duplicate your question here if it's already been asked on StackOverflow (https://stackoverflow.com/questions/48963157/bsdatepicker-doesnt-show-up-ngx-bootstrap)

Please provide a reproduction of this issue, because we can't do much without it.
You can use one of the starter templates:
Plunkr: https://plnkr.co/edit/0NipkZrnckZZROAcnjzB?p=preview
StackBlitz: https://stackblitz.com/edit/ngx-bootstrap?file=app%2Fapp.module.ts

@IlyaSurmay man real problem is it doesn't work in children components which loaded with lazyLoading. If I add BsDatepickerModule.forRoot() to app.module.ts, It just shows app.component.html.

If I want to use this my children components, I have to add BsDatepickerModule.forRoot() to childModule which I want to use.

But ex: ModalModule.forRoots() works perfectly fine in children compontents If I just add ModalModule.forRoot() to app.module.ts :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghiscoding picture ghiscoding  路  3Comments

PascalHonegger picture PascalHonegger  路  3Comments

tuoitrexuquang picture tuoitrexuquang  路  3Comments

juanitavollmering picture juanitavollmering  路  3Comments

hugonne picture hugonne  路  3Comments