Skip to content

Instantly share code, notes, and snippets.

@HeroicEric
Created August 26, 2015 17:58
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 HeroicEric/3f54de302aa92b515438 to your computer and use it in GitHub Desktop.
Save HeroicEric/3f54de302aa92b515438 to your computer and use it in GitHub Desktop.
Wizard Form
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
save(string) {
alert(string);
},
cancel(string) {
alert(string);
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{#x-form as |actions title|}}
Something in the block
<h1>{{title}}</h1>
<button {{action actions.save "another thing"}}>Save</button>
<button {{action actions.cancel}}>Cancel</button>
{{/x-form}}
this is the form
<p>{{yield (hash save=(action "save") cancel=(action "cancel" "something") "Wizar's Lair"}}</p>
{
"version": "0.4.8",
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.8/ember.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.9/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.8/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment