Skip to content

Instantly share code, notes, and snippets.

@baroquon
baroquon / components.child-component.js
Last active August 21, 2019 23:14
Context and Actions
import Ember from 'ember';
export default Ember.Component.extend({
label: "child-component"
});
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['red']
});
@baroquon
baroquon / controllers.application.js
Created November 19, 2018 17:23
input type="number"
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';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@baroquon
baroquon / controllers.application.js
Created September 6, 2017 18:59 — forked from samselikoff/mirage.config.js
Mirage dev boilerplate
import Ember from 'ember';
export default Ember.Controller.extend({
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
arr: [1, 2, 3],
arrPuted: Ember.computed('arr', function(){
return this.get('arr') + " hello!"
}),
actions: {
replaceArr(){
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
init(){
Ember.run.later(()=> this.set('volume', .5), 1)
//this.set('volume', .5)
}
});
@baroquon
baroquon / controllers.application.js
Created March 21, 2017 13:13
helper in controller
import Ember from 'ember';
import { myHelper } from '../helpers/my-helper';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
test: Ember.computed(function(){
return myHelper();
})
});
import Ember from 'ember';
let baseObj = Ember.Object.extend({
talk(){
alert('hey from baseObj');
}
});
let extendObj = baseObj.extend({
talk(){
alert('hey from extendObj');