Skip to content

Instantly share code, notes, and snippets.

@Sinled
Sinled / controllers.application.js
Last active April 14, 2018 07:31
nested-query-params
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
import Ember from 'ember';
export default Ember.Component.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
Ember.onerror = (error) => {
alert(error.message)
}
@Sinled
Sinled / controllers.application.js
Last active March 22, 2017 10:06
ember-cp-validations-validate-relations-with-debounce
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@Sinled
Sinled / adapters.application.js
Created March 20, 2017 15:11
check-double-save
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
createRecord(...params) {
alert('createRecord');
return Ember.RSVP.Promise.resolve({
data: {
type: 'tournament',
id: Date.now(),
@Sinled
Sinled / controllers.application.js
Last active August 28, 2018 18:39
deleteRecord-on-polymorhic-models
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
deleteRelation(relation) {
relation.deleteRecord();
}
}
@Sinled
Sinled / controllers.application.js
Last active February 6, 2017 16:08
nestedQueryParamsBehaviuor
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@Sinled
Sinled / controllers.application.js
Created January 27, 2017 12:58
check-ember-composable-helpers
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
someCollection: [
{ id: 1 },
{ id: 2 },
{ id: 3 },
{ id: 4 },
@Sinled
Sinled / adapters.application.js
Last active October 4, 2016 19:16
silent fail
import DS from 'ember-data';
export default DS.Adapter.extend({
// Mock response
queryRecord: function(store, type, query) {
return new Ember.RSVP.Promise(function(resolve, reject) {
console.log('fetching data');
resolve({ some: 'some string', id: 1 });
});
}
import Ember from 'ember';
const Item = Ember.Object.extend({
id: 0
});
export default Ember.Controller.extend({
name: "Вася",
list: [],