Skip to content

Instantly share code, notes, and snippets.

Avatar

Scott Kidder scottkidder

  • Grand Rapids, Michigan
View GitHub Profile
@scottkidder
scottkidder / controllers.application.js
Created Jun 22, 2018 — forked from jcope2013/controllers.application.js
Change value in response to update action on one way number mask
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
num: 0,
actions: {
update(unmaskedValue, value){
let number = parseInt(unmaskedValue, 10);
if(number > 15){
this.set('num', 15);
View components.color-chooser.js
import Ember from 'ember';
export default Ember.Component.extend({
colors: ['red', 'orange', 'yellow']
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
model: Ember.Object.create({
title: {
en: "example",
pt: "exemplo"
},
description: {
en: "description example",
@scottkidder
scottkidder / application.controller.js
Created Oct 29, 2015
Computed not firing on hash
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
hash: {
firstItem: 'abc',
},
getFirstItem: Ember.computed('hash', function() {
return this.get('hash.firstItem');
}),
actions: {
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View application.controller.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
View a-testing-component.component.js
import Ember from 'ember';
export default Ember.Component.extend({
});