Skip to content

Instantly share code, notes, and snippets.

import Ember from 'ember';
const { Controller, on, get } = Ember;
export default Controller.extend({
data: [],
start: on('init', function() {
const data = get(this, "data");
for (let x=0;x<1000;x++)
@sbatson5
sbatson5 / application.controller.js
Created October 26, 2015 15:38
Type fast - no cap
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
@sbatson5
sbatson5 / application.controller.js
Last active November 24, 2015 23:46
Image changer
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
import Ember from 'ember';
const { computed, get } = Ember;
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
loan: 1000,
invest: 500,
isLoanGreater: computed.gte('loan', 'invest'),
@sbatson5
sbatson5 / components.checkbox-component.js
Last active September 19, 2016 20:34
Input id not updating
import Ember from 'ember';
const { computed, get, set } = Ember;
export default Ember.Component.extend({
inputId: computed('index', 'todo.{course,completed}', {
get() {
return `${get(this, 'todo.course')}__${get(this, 'index')}`;
}
}),
@sbatson5
sbatson5 / controllers.application.js
Last active September 30, 2016 14:37 — forked from jelhan/controllers.application.js
ember-cli-flash in acceptance test
import Ember from 'ember';
const { inject } = Ember;
export default Ember.Controller.extend({
actions: {
addFlashMessage() {
this.get('flashMessages').info('just a test');
}
},
@sbatson5
sbatson5 / components.text-area.js
Created October 30, 2016 23:45
Ember-keyboard issue
import Ember from 'ember';
import { EKMixin, keyDown as keyDownEvent } from 'ember-keyboard';
export default Ember.TextArea.extend(EKMixin, {
keyDown(e) {
console.log('normal keydown');
},
datKeyDown: Ember.on(keyDownEvent('Enter'), function() {
console.log('keydown triggered from on');
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@sbatson5
sbatson5 / components.foo-bar.js
Created June 6, 2017 19:55
Conditional child class
import Ember from 'ember';
export default Ember.Component.extend({
});