mercredi 17 juin 2015

Wrapping Input with Custom Component EmberJS

Inside my controller's template, I have the following:

{{input value=user_stats_date class="form-control" type="text" size="25"}}

In my controller, I have a query param: user_stats_date

If I type characters into the input field, this will dynamically update the query params in the controller and the URL will update accordingly.

However, when I stick

{{input value=user_stats_date class="form-control" type="text" size="25"}}

into a component's template, this behavior is no longer the case. How do I ensure that the query param gets updated in the controller using the component?

I have also tried

{{input value=val class="form-control" type="text" size="25"}}

and

{{component val=val}}

Additionally, is there a way for me to not have to specify each input argument inside my component template but be able to pass in arguments optionally to the component as if it was an input tag?

Note: I am using Ember 1.12

Aucun commentaire:

Enregistrer un commentaire