Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
store: Ember.inject.service(),
actions: {
createClosing() {
const closing = this.get('store').createRecord('closing');
this.set('closing', closing);
save() {
import Model from "ember-data/model";
import attr from "ember-data/attr";
import { belongsTo, hasMany } from "ember-data/relationships";
export default Model.extend({
value: attr('number'),
<h1>Welcome to {{appName}}</h1>
<h2>Valor: {{closing.value}}</h2>
<button onclick={{action "createClosing"}}>Criar</button>
{{#if closing}}
<form onsubmit={{action "save"}}>
<label>Value {{input value=closing.value}}</label>
<button type="submit">Salvar</button>
"version": "0.10.7",
"EmberENV": {
"options": {
"use_pods": false,
"enable-testing": false
"dependencies": {
"jquery": "",
"ember": "2.10.0",
"ember-data": "2.10.0",
"ember-template-compiler": "2.10.0",
"ember-testing": "2.10.0"
"addons": {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment