Skip to content

Instantly share code, notes, and snippets.

View sukima's full-sized avatar

Devin Weaver sukima

View GitHub Profile
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
flat = {
'some.nested.keys': 'flat'
};
nested = {
some: {
nested: {
@sukima
sukima / countries.json
Last active December 8, 2020 13:31 — forked from keeguon/countries.json
A list of countries in JSON
[
{"name": "Afghanistan", "code": "AF"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Albania", "code": "AL"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "AndorrA", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
@sukima
sukima / controllers.application.js
Created March 16, 2019 12:03 — forked from Alonski/controllers.application.js
ember-data 3.7 relationships
import Controller from '@ember/controller';
import { reads } from '@ember/object/computed';
export default Controller.extend({
children: reads('model'),
actions: {
clickChild(child) {
child.parent.then(parent => {
console.log(parent.name);
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Component.extend({
actions: {
open(){
//do stuff
let image = 'yay image'
this.get('childManager').select(image)
}
}
@sukima
sukima / controllers.application.js
Created April 17, 2018 20:53 — forked from aaronfischer/controllers.application.js
test iterate object and change value
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
thing: {
'first-name': '',
'last-name': '',
'status': '',
},
@sukima
sukima / application.controller.js
Last active January 2, 2018 19:55 — forked from piotrpalek/application.controller.js
inherited computed property
import Ember from 'ember';
import CoreController from '../core/controller';
const { computed } = Ember;
export default CoreController.extend({
queryParams: ['appName', 'foobar'],
appName: 'Ember Twiddle',
foobar: 'baz',
something: computed('{appName,foobar}', {
@sukima
sukima / controllers.application.js
Last active November 23, 2017 13:00 — forked from averydev/controllers.application.js
Ember Concurrency Task Model / Nested Routes
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Concurrency Decendants'
});
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
});
@sukima
sukima / test.js
Last active May 9, 2024 23:49 — forked from robneville73/test.js
firstReport: computed.alias('reports.firstObject'),
someOtherThing: computed('reports.[]', function() {
return get(this, 'reports').map(report => doCoolStuff(report));
}),
...
...
...
getReports: task(function*() {