I’m currently building out a route controller that has a query param that is used to determine the display state of a child component. Basically whether to display the data as a table or graph.
As it is currently built, the controller passes the property to the component, and the component can modify the property through a select element. In this configuration, the value is 2 way bound, which is something I would like to avoid.
What would be the most correct method for passing the query param to the component as read only data so that I can manipulate it via action?
Some blog posts have lead me to the readonly helper, but I’m weary to use it as I haven’t found any documentation on it.
You’re right, it’s not in the API docs but does exist. IMO, I would still use it. There has been work done for support in Glimmer 2, so you know it’ll stick around.
At this point, I think it’s the best approach. I believe Ember is going to be one-way by default in the future, but I don’t know the timeline on that. (Basically {{readonly}} by default, not needing the helper, but then re-enable two-way by using the {{mut}} helper.)