Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Action for input-helper

Tags:

ember.js

I have a textfield, which I want to have a 'dynamic' placeholder text (definied and managed in the view), but I also want it to have an action defined for it. I tried the two following lines:

{{ input id="test" placeholder=view.text action expand target="view"}}

<input type="text" id="test" placeholder="{{view.text}}" {{action expand target="view"}} />

Both are not working. So my question is, is there a way to achieve what I want or would it be easier to have a focus handler in the view, which just filters for the id (and then calls the expand function)?

like image 249
Markus Avatar asked Dec 08 '22 14:12

Markus


1 Answers

If you want to stick to input helpers, you can do something like this:

{{input placeholder=view.text action="expand" targetObject=view}}

Notice that targetObject should not be a string.

like image 144
mhadianfard Avatar answered Jan 12 '23 01:01

mhadianfard