Comments (5)
You are right about the SharedModule export, that was the thing I was missing, thank you.
from ng-trim-value-accessor.
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.
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.
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.
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)
- touched broken for matInput HOT 3
- TypeError: Class constructor DefaultValueAccessor cannot be invoked without 'new' HOT 7
- inputs(except those whose type is password) are always untouched HOT 2
- Email inputs are not updated
- doesn't work when an input has [readonly]="condition" data-binding HOT 5
- bound value not set
- I get "More than one custom value accessor matches form control with unspecified name attribute" HOT 1
- why at the end of the apostrophe?
- core.js:1598 ERROR Error: Uncaught (in promise): Error: More than one custom value accessor matches form control with unspecified name attribute HOT 1
- Unable to use [(ngModel)] in mat-autocomplete when ng-trim-value-accessor is used HOT 1
- Does not work with Ivy HOT 2
- not support in Angular 8 HOT 4
- Doesn't work with closure compiler HOT 2
- Trim should not be applied to input type number HOT 1
- Apply trimmed value on blur HOT 5
- ng build --prod fails with `...src/trim-value-accessor.ts has no selector, please add it!` HOT 1
- Error: More than one custom value accessor
- Provide an op-out option
- Does not run with Angular 5 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-trim-value-accessor.