Giter Club home page Giter Club logo

Comments (12)

NetanelBasal avatar NetanelBasal commented on June 15, 2024

You're welcome to submit a PR.

from forms-manager.

adrianriepl avatar adrianriepl commented on June 15, 2024

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.

NetanelBasal avatar NetanelBasal commented on June 15, 2024

You can do it yourself without upgrading anything.

from forms-manager.

NetanelBasal avatar NetanelBasal commented on June 15, 2024

You can also add markAllAsDirty.

from forms-manager.

adrianriepl avatar adrianriepl commented on June 15, 2024

Okay then I'll do it without upgrading it. I'll do a PR as soon as I find some time.

from forms-manager.

adrianriepl avatar adrianriepl commented on June 15, 2024

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?

My fork

from forms-manager.

NetanelBasal avatar NetanelBasal commented on June 15, 2024

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.

NetanelBasal avatar NetanelBasal commented on June 15, 2024

You should do something like https://stackoverflow.com/a/44150793/7330592

from forms-manager.

adrianriepl avatar adrianriepl commented on June 15, 2024

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.

NetanelBasal avatar NetanelBasal commented on June 15, 2024

You are right. When do you see the error?

from forms-manager.

adrianriepl avatar adrianriepl commented on June 15, 2024

You will see the error when you click on the save button in the demo application. Here I call this.manager.markAllAsTouched('stepOne').

https://github.com/adrianriepl/forms-manager/blob/b6751ba9af2569928439316823d9ef758bac9175/src/app/demo/demo.component.ts#L50

from forms-manager.

NetanelBasal avatar NetanelBasal commented on June 15, 2024

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)

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.