Skip to content

Instantly share code, notes, and snippets.

@spr1ne
spr1ne / components.my-component\.js
Last active November 27, 2020 08:23
New Twiddle
import Component from '@glimmer/component';
export default class extends Component {
}
@spr1ne
spr1ne / controllers.application\.js
Last active November 13, 2020 13:57
New Twiddle
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
import { run } from '@ember/runloop';
const { stringify } = JSON;
export default class ApplicationController extends Controller {
maxId = 6;
@tracked
@spr1ne
spr1ne / controllers.application\.js
Last active August 14, 2020 08:42
ember-dragula
import Controller from '@ember/controller';
import { tracked } from '@glimmer/tracking';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
@tracked
listOne = [{ name: 'Item 1' }, { name: 'Item 2' }, { name: 'Item 3' }];
@tracked
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@action
uploadImage() {
console.log('yes');
}
import Controller from '@ember/controller';
import { action } from '@ember/object';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@action
submitAction(e) {
e.preventDefault();
console.log(e, 'test');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
names: [ "María", "Søren Larsen", "João", "Saša Jurić", "Íñigo" ]
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
actions: {
test() {
console.log(arguments);
}
});
@spr1ne
spr1ne / adapters.application.js
Last active November 28, 2018 19:32
Detect type DS 2
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
host: 'https://jsonplaceholder.typicode.com',
});