Ember Latest
The latest build of Ember.
HTML
<script src="http://builds.handlebarsjs.com.s3.amazonaws.com/handlebars-v2.0.0.js"></script>
<script src="http://builds.emberjs.com/ember-latest.js"></script>
<script type="text/x-handlebars" data-template-name="application">
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
{{input type='text' value='First name'}}
{{form-actions save='save'}}
</script>
<script type="text/x-handlebars" data-template-name="components/form-actions">
<footer class="action-bar">
<button {{action 'didSaveObject'}}>Save</button>
</footer>
</script>
CSS
.action-bar {
margin-top: 10px;
}
JavaScript
App = Ember.Application.create();
App.IndexRoute = Ember.Route.extend();
App.IndexController = Ember.Controller.extend({
actions: {
save: function () {
alert('custom save');
}
}
});
App.FormActionsComponent = Ember.Component.extend({
save: null,
actions: {
didSaveObject: function () {
this.sendAction('save');
}
}
});