Skip to content

Instantly share code, notes, and snippets.

Sylwia sylwiaeb

  • Decile
  • PL
View GitHub Profile
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
selected: {name: 'All', id:0},
computedOptions: Ember.computed('options.[]', function(){
return this.get('options').slice().insertAt(0, this.get('selected'));
})
});
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init() {
this._super(...arguments);
this.set('options', [true, false]);
this.set('selectedOptions', true);
}
View components.my-list.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: 'ul',
classNames: 'list-options',
selectedOption: null,
init() {
this._super(...arguments);
this.set('options', [
View controllers.application.js
import Ember from 'ember';
import { computed } from '@ember/object';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.my-slider-item.js
import Ember from 'ember';
import { A } from '@ember/array';
export default Ember.Component.extend({
init() {
this._super(...arguments);
//this.get('registerItem')(this);
}
View components.blank-template.js
import Ember from 'ember';
export default Ember.Component.extend({
tagName: ''
});
View components.ember-input-wrapper.js
import Ember from 'ember';
export default Ember.Component.extend({
});
@sylwiaeb
sylwiaeb / random-string
Created May 16, 2018
Generate a random string with limit in JavaScript
View random-string
const generateString = (limit) => {
return new Date().getTime().toString().repeat(limit).substring(0, limit);
};
generateString(10); // 1526477455
@sylwiaeb
sylwiaeb / route-test.js
Created Apr 16, 2018 — forked from benbabics/route-test.js
Ember Mock Service
View route-test.js
import Ember from 'ember';
import { moduleFor, test } from 'ember-qunit';
let mockSession = Ember.Service.extend({
isAuthenticated: true,
currentUser: Ember.computed('isAuthenticated', function() {
return Ember.RSVP.Promise(function(resolve) {
resolve( Ember.Object.create({ accounts: [] }) );
});
})
View mirage-tils.org

Version: ^0.2.0-beta.5

How can I check the serialized version of a model?

server.get('api/employee's, function(schema, request) {
  employee = schema.employee.find(1);
  this.serializerOrRegistry.serialize(employee, request);

  return foo;
});
You can’t perform that action at this time.