Last active
July 20, 2019 17:35
CP access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
import EmberObject, { computed } from '@ember/object'; | |
import { dasherize } from '@ember/string'; | |
let Band = EmberObject.extend({ | |
name: '', | |
language: '', | |
slug: computed('name', function() { | |
console.log('Recomputing slug'); | |
return dasherize(this.name); | |
}), | |
site: computed('slug', 'language', function() { | |
console.log('Recomputing site'); | |
return `https://bands.com/${this.slug}.${this.language}`; | |
}) | |
}); | |
let band = Band.create({ name: 'Mookie Blaylock', language: 'jsp' }); | |
console.log(1, band.site); | |
console.log(2, band.site); | |
band.set('name', 'Pearl Jam'); | |
console.log(3, band.site); | |
band.set('language', 'php'); | |
console.log(4, band.site); | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment