Comments (12)
You're welcome to submit a PR.
from forms-manager.
markAllAsTouched()
is only available since Angular 8.0.0, so the project would need to be updated to at least this version. So there might be some more changes than just adding the above mentioned methods.
from forms-manager.
You can do it yourself without upgrading anything.
from forms-manager.
You can also add markAllAsDirty
.
from forms-manager.
Okay then I'll do it without upgrading it. I'll do a PR as soon as I find some time.
from forms-manager.
I tried to implement the mark* methods but I am struggling a little bit. Maybe I made a mistake somewhere or have a misunderstanding how the library is structured. I have the following problem:
- When using
markAllAsTouched()
I'll get the error =>core.js:4117 ERROR TypeError: this._forEachChild is not a function at Object.push../node_modules/@angular/forms/__ivy_ngcc__/fesm5/forms.js.AbstractControl.markAllAsTouched (forms.js:2951)
- When I use a "normal" method such as
markAsDirty()
the property of the control does not change.
Can somebody help me out?
from forms-manager.
You can't call https://github.com/adrianriepl/forms-manager/blob/master/projects/ngneat/forms-manager/src/lib/forms-manager.ts#L261. As you said, it is only available since Angular 8.0.0.
from forms-manager.
You should do something like https://stackoverflow.com/a/44150793/7330592
from forms-manager.
I forked the library after the last commit (where it was changed to Angular 9.1.11) so it should be available already or am I not seeing something?
from forms-manager.
You are right. When do you see the error?
from forms-manager.
You will see the error when you click on the save button in the demo application. Here I call this.manager.markAllAsTouched('stepOne')
.
from forms-manager.
I'll check it later. But try to debug it. Add a debugger statement and see why you get the error.
from forms-manager.
Related Issues (19)
- valueChanges in unit tests HOT 2
- Add getInitialValue() function to get the initial form value already stored in forms-manager HOT 2
- Forms with update on blur, value not available immediately using getControl().value HOT 4
- Request for enhance setup and basic usage documentation HOT 11
- Improve Typings HOT 6
- Slow to update state? HOT 2
- Add parse and serializer options for persistState HOT 3
- FormArray with FormGroups inside
- FormGroup upsert takes value of previous FormGroup
- Initial values not being cleared using blank clear or destroy methods HOT 2
- Add dirty functionality HOT 14
- should remove this equal sign HOT 1
- persist some control only
- Get values of persisted form in another component? HOT 1
- you added more brackets HOT 1
- Support for a custom storage provider HOT 15
- Ivy support HOT 3
- Mat Date Picker value doesn't persist to local storage HOT 1
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 forms-manager.