-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More context on TODO: on and fn #4
Comments
Hi, a non-obvious example that IMHO would be useful would be how to replace this pattern: {{my-component onChange=(action (mut something) value="target.value")}} It's hard to find any information regarding how to write this using the |
@simonc great question. I ran into this issue today.
import { helper } from '@ember/component/helper';
// emulate the old action helper behavior
// so we keep keep DOM specifics to templates
// idea lifted from @NullVoxPopuli
export default helper(function getInputValue([func]) {
return ({ target }) => {
return func(target.value);
}
}); Then I consume values using: <input
value={{this.aProperty}}
{{on 'input' (get-input-value (fn (mut this.aProperty)))}}
placeholder='Edit Me'
/> |
@efx Thanks for this! Very cool little helper 😊 |
@jenweber Need more clarification on what we are talking about. Would be helpful to create PRs for the same.
https://github.com/jenweber/ember-octane-vs-classic-cheat-sheet/blob/506561b9487c280b8334769262839a78110b7c9c/index.html#L314
The text was updated successfully, but these errors were encountered: