Giter VIP home page Giter VIP logo

Comments (11)

Agranom avatar Agranom commented on May 26, 2024

It occurs when you try to import Timepicker module to SharedModule ? What does it mean you try to "share" it ?

from ngx-material-timepicker.

maciejniedzielski avatar maciejniedzielski commented on May 26, 2024

It mean that I just want to put this module to SharedModule and use Timepicker in different module than app.module.ts

from ngx-material-timepicker.

Agranom avatar Agranom commented on May 26, 2024

Can you download you app to github and show me? Or just show me the way you use it please

from ngx-material-timepicker.

maciejniedzielski avatar maciejniedzielski commented on May 26, 2024

Unfortunately I can't upload app code anywhere, so I will try to explain it.

Important app dir structure:
-src
-app
app.module.ts (root app module)
-shared
shared.module.ts (external libraries modules)

shared.module.ts has array named EXTERNAL_LIBRARIES_MODULES which includes modules of external libraries and this array is passed to shared.module.ts @NgModule imports array.

zrzut ekranu deepin_wybierz-obszar_20180524125419
zrzut ekranu deepin_wybierz-obszar_20180524125330

and this shared.module.ts is imported in app.module.ts
zrzut ekranu deepin_wybierz-obszar_20180524125652

If it is't clear and understandable enough let me know.

from ngx-material-timepicker.

Agranom avatar Agranom commented on May 26, 2024

Yes, it's clear enough. Which version of angular do you use?

from ngx-material-timepicker.

maciejniedzielski avatar maciejniedzielski commented on May 26, 2024

@angular/core 5.2.4 and @angular-cli 1.6.8

from ngx-material-timepicker.

Agranom avatar Agranom commented on May 26, 2024

Ok, i'll try to reproduce it by my own

from ngx-material-timepicker.

Agranom avatar Agranom commented on May 26, 2024

I found out the problem. That's because you try to export NgxMaterialTimepickerModule.forRoot()
forRoot() function returns ModuleWithProviders, but you need to export NgModule. So add NgxMaterialTimepickerModule.forRoot() to imports and NgxMaterialTimepickerModule to exports in SharedModule and it should work.
image

from ngx-material-timepicker.

maciejniedzielski avatar maciejniedzielski commented on May 26, 2024

I did like you said but now this error has occured:
zrzut ekranu deepin_wybierz-obszar_20180524154742
BUT, I forgot to mention (I think) very important fact: Modules are lazy loaded.
I also forgot to mention about one module in app tree

-src
   -- app
   app.module.ts
   -- shared
   shared.module.ts
   -- user-management
   user-management.module.ts

and in user.management.module.ts i've got these imports
zrzut ekranu deepin_wybierz-obszar_20180524154805
Ultimately, I want to use timepicker in user-management.module.ts

Sorry for mistakes. Hope you will have some time to help me again 🙂

from ngx-material-timepicker.

Agranom avatar Agranom commented on May 26, 2024

I guess I found the problem. I updated library to 1.1.2 update it and tell me

from ngx-material-timepicker.

maciejniedzielski avatar maciejniedzielski commented on May 26, 2024

It works! Thank you so much for help! 😃

from ngx-material-timepicker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.