Code Monkey home page Code Monkey logo

Comments (7)

nzbin avatar nzbin commented on May 27, 2024

Please give me an online example

from extensions.

andreanaFelicione avatar andreanaFelicione commented on May 27, 2024

Here is a test project: testStackBlitz

from extensions.

nzbin avatar nzbin commented on May 27, 2024

I can't find issues about mtx-select in your demo. But I'd like to point out a few irregularities.
If you want to init the form in ngOnInit hook, you should define the form like this.

- form!: FormGroup
+ form?: FormGroup

But I think the best way to init Reactive Form should like this.

form = this.fb.group({
  test: 1
});

ngOnInit(): void {
  this.form.patchValue(...)
}

from extensions.

andreanaFelicione avatar andreanaFelicione commented on May 27, 2024

Clicking the button the select should set value to "Setted Value", instead it remain with "Default Value" and shows the error "There is no FormControl instance attached to form control element with name: 'test'" in the console.
How can you say you don't find any issues?
This is the only component that behaves like this, all other material inputs do not cause problems with reinit of the formGroup.

PS. My entire project of thousands and thousands of lines is managed with reinitialized formGroups, the idea of ​​modifying everything using patchValue is absolutely unthinkable.

image

from extensions.

nzbin avatar nzbin commented on May 27, 2024

I'm sorry, it's indeed a problem, I'll try to fix it.

from extensions.

nzbin avatar nzbin commented on May 27, 2024

The new version 17.1.4 has fixed this issue, please try again.

from extensions.

andreanaFelicione avatar andreanaFelicione commented on May 27, 2024

Perfect.
It works now, thank you so much!

from extensions.

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.