Skip to content

Instantly share code, notes, and snippets.

@code0100fun
Created May 23, 2016 08:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save code0100fun/aac6369ba036bd5932578ddc21ec33bb to your computer and use it in GitHub Desktop.
Save code0100fun/aac6369ba036bd5932578ddc21ec33bb to your computer and use it in GitHub Desktop.
Actions Part 1
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Weekend',
actions: {
save() {
alert(`save: ${this.get('name')}`);
},
cancel() {
alert('cencel');
}
}
});
<h1>Welcome to {{appName}}</h1>
<button {{action "cancel"}}>Cancel</button>
<form {{action "save" on="submit"}}>
{{input value=name}}
</form>
{
"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