Skip to content

Instantly share code, notes, and snippets.

@piotrpalek
Created November 3, 2016 16:02
Show Gist options
  • Save piotrpalek/5e4f937f5bad945062cbf0808079de7d to your computer and use it in GitHub Desktop.
Save piotrpalek/5e4f937f5bad945062cbf0808079de7d to your computer and use it in GitHub Desktop.
ember2.10beta bug
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
this.get('store').pushPayload('my-model', {
data: {
type: 'my-model',
id: 1,
attributes: {
total: 234
}
}
});
this.set('model', this.get('store').peekAll('my-model').get('firstObject'));
}
});
import Model from "ember-data/model";
import attr from "ember-data/attr";
import { belongsTo, hasMany } from "ember-data/relationships";
export default Model.extend({
total: attr('format-number')
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{model.total}}
<br>
<br>
import Transform from 'ember-data/transform';
import Ember from 'ember';
export default Transform.extend({
deserialize(serialized, options) {
console.log('aaa');
return serialized;
},
serialize(deserialized) {
console.log('aaa');
return deserialized;
}
});
{
"version": "0.10.6",
"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.9.0",
"ember-data": "beta",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment