4

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)?

2 Answers 2

12

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.

Sign up to request clarification or add additional context in comments.

Comments

2

You could try to do it like this:

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

See here for a working example.

Hope it helps

1 Comment

AAhh yes, how did I not find that. Thank you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.