Ngx-bootstrap: There is no directive with "exportAs" set to "bsDatepicker

Created on 6 Nov 2017  Â·  11Comments  Â·  Source: valor-software/ngx-bootstrap

vendor.bundle.js:92610 ERROR Error: Uncaught (in promise): Error: Template parse errors:
There is no directive with "exportAs" set to "bsDatepicker" (" class="form-control"
[ERROR ->]#dp="bsDatepicker"
bsDatepicker [(bsValue)]="fromdate">

comp(datepicker) info reproduce

Most helpful comment

+1 still does not work even with the correct import.

All 11 comments

please use issue template. You haven't provided any information regarding versions of libs you're using, no reproduction via plunkr/stackblitz. We can't do much without that info.

Closed as can't reproduce, will be reopened if we have sample to reproduce

ERROR Error: Uncaught (in promise): Error: Template parse errors:
There is no directive with "exportAs" set to "bsDatepicker" ("

import { DatepickerModule} from 'ngx-bootstrap';
imports: [
DatepickerModule.forRoot()
],

"ngx-bootstrap": "2.0.0-beta.2",

We've got the same issue:
Reproducable in an empty ng-cli project and in a Stackblitz:
https://stackblitz.com/edit/ngx-bootstrap-zeswa8?file=app%2Fapp.module.ts
@IlyaSurmay Please reopen this issue

You're importing the wrong module. DatepickerModule is for old datepicker. Import BsDatepickerModule

It's work, Thank you

On Tue, Jan 2, 2018 at 12:39 PM, Ilya Surmay notifications@github.com
wrote:

You're importing the wrong module. DatepickerModule is for old datepicker.
Import BsDatepickerModule

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/valor-software/ngx-bootstrap/issues/2979#issuecomment-354739624,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AVl5t-wqDETV5mvKMVAdqZ0oYgS-KtJ9ks5tGgd3gaJpZM4QTPZV
.

--
Tel: +40 332 711 080
Tel: +39 011 19 82 06 94
Fax: +40 332 780 159
Web: www.bss-one.net

+1 still does not work even with the correct import.

Here https://github.com/valor-software/ngx-bootstrap/issues/2716
nuked said:

in my case i put BsDatepickerModule.forRoot() in global app.module.ts, but then I forgot to import same module inside of child module as well.

And that was my problem too. Maybe it's also yours.

It's work Thanks. I forgot to import same module inside of child module as well.

I got this error today with Angular 7 / ngx-bootstrap 3.0.1 ... turns out I was using bsDatePicker as html attribute instead of bsDatepicker (note the lowercase 'p').

I had the same issue, but my input element had maxLength attribute which was causing the issue. So make sure you do not have any other additional attribute which datepicker doesn't support.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

haisaco picture haisaco  Â·  3Comments

KimBum picture KimBum  Â·  3Comments

ctrl-brk picture ctrl-brk  Â·  3Comments

ravirajhalli picture ravirajhalli  Â·  3Comments

tpiros picture tpiros  Â·  3Comments