Skip to content

Instantly share code, notes, and snippets.

@code0100fun
Last active May 23, 2016 14:20
Show Gist options
  • Select an option

  • Save code0100fun/79899d36bdf296fa1ea80272df7271b1 to your computer and use it in GitHub Desktop.

Select an option

Save code0100fun/79899d36bdf296fa1ea80272df7271b1 to your computer and use it in GitHub Desktop.
Actions Part 3
import Ember from 'ember';
const { get } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Weekend',
events: [],
actions: {
changed(value) {
get(this, 'events').pushObject('Changed Event');
}
}
});
<h1>Welcome to {{appName}}</h1>
{{input value=name key-up=(action "changed")}}
{{#each events as |event|}}
<p>{{event}}</p>
{{/each}}
{
"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