Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HusseinMorsy/1c0141937c104a08878515151e79a2a5 to your computer and use it in GitHub Desktop.
Save HusseinMorsy/1c0141937c104a08878515151e79a2a5 to your computer and use it in GitHub Desktop.
Actions Part 4
import Ember from 'ember';
const { get } = Ember;
export default Ember.Controller.extend({
events: [],
actions: {
changed(message1, message2) {
get(this, 'events').pushObjects([message1, message2]);
}
}
});
<h1>Actions Part 4: Currying</h1>
{{curry-comp changed=(action "changed" "From parent")}}
{{#each events as |event|}}
<p>{{event}}</p>
{{/each}}
{{input value=name key-up=(action this.attrs.changed "Hello From Component")}}
{
"version": "0.8.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.5.1",
"ember-data": "2.5.2",
"ember-template-compiler": "2.5.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment