Skip to content

Instantly share code, notes, and snippets.

Sylvain MINA sly7-7

Block or report user

Report or block sly7-7

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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'),
});
View package.json
"_args": [
[
"ember-data@^2.3.1",
"/Users/sma01/work/frontend"
]
],
"_from": "ember-data@>=2.3.1 <3.0.0",
"_id": "ember-data@2.4.3",
"_inCache": true,
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
store: Ember.inject.service(),
init() {
this._super(...arguments);
this.get('store').push({data: [{
id: 42,
type: 'plic',
View application.controller.js
import Ember from 'ember';
var FilePath = Em.Object.extend({
default: null,
fileName: Em.computed.oneWay('default'),
path: Em.computed('fileName', function() {
return '/path/' + this.get('fileName');
})
});
View application.controller.js
import Ember from 'ember';
const { computed } = Ember;
export default Ember.Controller.extend({
commentArray: computed('model.comments.[]', function() {
return this.get('model.comments').toArray();
}),
favourites: computed.filterBy('model.comments', 'isFavourite'),
favouritesHack: computed.filterBy('commentArray', 'isFavourite'),
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
owner: Ember.computed(function() {
return this.store.createRecord('owner');
}),
init() {
You can’t perform that action at this time.