question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NgbDateNativeAdapter provided in app.module sems not be considered

See original GitHub issue

Bug description:

When providing the NgbDateNativeAdapter in app.module.ts with typescript providers: [ { provide: NgbDateAdapter, useClass: NgbDateNativeAdapter } ]

my model value is bound to a NgbDateStruct-Value representing the selected date. I expected it to be a “native” date, as transformed by NgbDateNativeAdapter.

Link to minimally-working plunker that reproduces the issue:

http://plnkr.co/edit/lkfKKxk63EjuoVWJrpiT?p=preview

Version of Angular, ng-bootstrap, and Bootstrap:

Angular: 6.1.3

ng-bootstrap: 3.0.0

Bootstrap: 4.1.3

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
pkozlowski-opensourcecommented, Aug 17, 2018

We can confirm it as a bug / regression in 3.0.0 - will fix in next release (to be cut early next week). Thnx for reporting!

1reaction
omardomacommented, Aug 17, 2018

The adapter does not work if you provide it in the AppModule and then use the DatePicker in a Lazy Loaded Feature module, I had to provide the adapter in the Feature module itself, in order that it can work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ngbDatepicker with fromgroup not able to preset value (Native ...
I faced a similar issue. To solve import NgbDateNativeAdapter, NgbDateAdapter from @ng-bootstrap. import { NgbDateNativeAdapter ...
Read more >
Angular Services, providedIn and Lazy Modules - | juri.dev
In this article we're going to explore some dependency injection particularities with Angular, specifically in combination with lazy loaded ...
Read more >
Datepicker - Angular powered Bootstrap
The latest date that can be displayed or selected. If not provided, 'year' select box will display 10 years after the current month....
Read more >
Angular Services, providedIn and Lazy Modules
It will tell angular application to provide the service in the application ... When you provide service as lazy loading module, then not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found