Giter Site home page Giter Site logo

Comments (6)

liamdebeasi avatar liamdebeasi commented on May 8, 2024

Thanks for the report. I'm going to merge this with #28876. The underlying issue is the same, but it looks like my setInput fix in the linked PR isn't enough to resolve the issue. I'll see if there's a better way to resolve this and post updates in the linked thread.

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on May 8, 2024

Hey there! I spoke with the team, and the usage in your demo is incorrect which results in the error. Since myModelInput is already a writeable signal, you don't need to pass another signal when setting componentProps, just the value of the signal is sufficient.

For example, your application passes signal(['one', 'two', 'three']), but you only need to pass ['one', 'two', 'three']. Under the hood we use Angular's setInput API which will take care of correctly updating the signal value while still keeping the data reactive.

from ionic-framework.

ntorrey avatar ntorrey commented on May 8, 2024

@liamdebeasi
Interesting! It works, but only partially.
First of all, that's counter-intuitive to what I originally thought since in an angular component, if you want bi-directional reactivity with a model input you have to pass the signal itself and not just the 'unwrapped' value (by calling it with a () at the end.)
Secondly, after testing I noticed that only the first value is pushed back to the original signal in the app.component.
I updated the reproduction which hopefully gets the point across.

from ionic-framework.

ntorrey avatar ntorrey commented on May 8, 2024

@liamdebeasi
Sorry for the ping! Just wanted to make sure my comment above doesn't get lost in the shuffle since this issue is marked as closed. Should it be reopened?

from ionic-framework.

liamdebeasi avatar liamdebeasi commented on May 8, 2024

It's possible that we need more clarification from the Angular team, but according to the existing documentation the usage noted in #29013 (comment) is correct.

It does not seem that the controllers have ever supported two way bindings via a single property, so that could be part of the issue here. The controller approach isn't ideal for reactive properties which is why we introduced the inline overlay syntax. You might want to try using an inline modal here instead.

from ionic-framework.

ntorrey avatar ntorrey commented on May 8, 2024

Being able to use two-way binding via a controller would be great DX for me, but I get how it is complicated. The inline overlay syntax isn't as handy for modal components that I want to reuse in many different places.

from ionic-framework.

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.