joanllenas / ngx-date-fns

⏳ date-fns pipes for Angular
164 stars 14 forks source link

Documentation for lazy loaded modules #346

Closed MickL closed 3 years ago

MickL commented 3 years ago

When having lazy loaded modules:

- AppModule
    - LazyModule1
    - LazyModule2

Should AppModule import with forRoot() and all others without? Or should all 3 import with forRoot?

Maybe would be nice if you could add this information to the docs, too :)

joanllenas commented 3 years ago

Hi @MickL , thanks for reporting.

TL;DR

Use DateFnsModule in lazy loaded modules, DateFnsModule.forRoot() only in the root module.

Enhancements

I added an example in the demo app and a note in the readme. Details here: https://github.com/joanllenas/ngx-date-fns/commit/1bfe54fd232e39b34e48bbe43a99dea3782d8593

Hope this clarifies your issue!