Git Product home page Git Product logo

Comments (5)

nulayuhz avatar nulayuhz commented on August 11, 2024 1

You are right about the SharedModule export, that was the thing I was missing, thank you.

from ng-trim-value-accessor.

khashayar avatar khashayar commented on August 11, 2024

Thanks for submitting the PR for this, but before merging it, can you please elaborate more on your issue?
What version of Angular are you using? Are you importing it in the AppModule? Can you share a code sample?

Regarding the fix with the forRoot, here's a quote from Angular's doc page:

Use forRoot() to separate providers from a module so you can import that module into the root module with providers and child modules without providers.

I'm not sure that's exactly what we need here but it's good to know whether you've tested your solution and if it solves the issue.

from ng-trim-value-accessor.

nulayuhz avatar nulayuhz commented on August 11, 2024

Hi, I am using Angular 5, the issue I am having is when I import it under AppModule, the value accessor is not working in components in the child modules. Sorry for creating a PR without testing, let I verify and do some testings.

from ng-trim-value-accessor.

khashayar avatar khashayar commented on August 11, 2024

I'm using it currently in Angular 7 and importing this module inside the SharedModule and exporting it back. This way it's accessible through the feature modules.

from ng-trim-value-accessor.

zolakt avatar zolakt commented on August 11, 2024

Is there any other solution for this?

Using the SharedModule is a workaround. Basically the same as importing it directly in every child module, just with less scattered code. It is not applicable to a lot of use cases.

For example, I have 3 apps: 1 library project, and 2 apps that use the library.
Inside the library there are some textareas that I want trimmed.
In the 1st app I want to use the trimming, but not in the 2nd app.
So, I can't push this module import all the way down to the library project.
I want to import it only in the AppModule of the 1st app.

from ng-trim-value-accessor.

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.