Skip to content

Instantly share code, notes, and snippets.

Avatar

Sylvain MINA sly7-7

View GitHub Profile
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
});
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
View controllers.application\.js
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
View controllers.application\.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
store: Ember.inject.service(),
get firstThing() {
return this.model.hasMany('things').value().firstObject;
},
View adapters.application.js
import Ember from 'ember';
import RSVP from 'rsvp';
export default Ember.Object.extend({
findRecord(_, __, id) {
return new RSVP.Promise(resolve => {
setTimeout(resolve, parseInt(id) * 350);
}).then(() => {
return {
data: {
View adapters.application.js
import Adapter from "ember-data/adapters/json-api";
export default Adapter.extend();
@sly7-7
sly7-7 / .block
Last active Feb 16, 2017
extended mirror barchart
View .block
license: mit
@sly7-7
sly7-7 / trigger.hbs
Created Nov 23, 2016
ember-power-select-typeahead with allowClear
View trigger.hbs
<input type="search"
value={{text}}
id="ember-power-select-typeahead-input-{{select.uniqueId}}"
class="ember-power-select-typeahead-input ember-power-select-search-input"
autocomplete="off"
placeholder={{placeholder}}
oninput={{onInput}}
onfocus={{onFocus}}
onblur={{onBlur}}
onkeydown={{action "handleKeydown"}}
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
destroyRecord(model) {
model.get('children').then( (children) => {
//children.invoke('deleteRecord');
//children.forEach( (child) => {
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
all: Ember.A([{id:3,text:'abb'},{id:1,text:'a'},{id:2,text:'ab'}]),
sortedQueue: Ember.computed.sort('all', 'sortProp'),
sortProp: ['id:desc'],
wrongSortedQueue: Ember.computed.sort('all', 'id:desc'),
});
You can’t perform that action at this time.