Skip to content

Instantly share code, notes, and snippets.

@sduquej
Created May 11, 2018 11:20
Show Gist options
  • Save sduquej/bd930a596b89aaa788ec5ba4a7464a8d to your computer and use it in GitHub Desktop.
Save sduquej/bd930a596b89aaa788ec5ba4a7464a8d to your computer and use it in GitHub Desktop.
readOnly
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
appNameInUppercase: Ember.computed('appName', function() {
return this.get('appName').toUpperCase();
}).readOnly(),
actions: {
messThingsUp() {
this.set('appNameInUppercase', 'lala');
}
}
});
<h1>Welcome to {{appName}}</h1>
{{appNameInUppercase}}
<button {{action 'messThingsUp'}}>CLICK ME</button>
<br>
{
"version": "0.13.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.16.2",
"ember-template-compiler": "2.16.2",
"ember-testing": "2.16.2"
},
"addons": {
"ember-data": "2.16.3"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment