Skip to content

Instantly share code, notes, and snippets.

@sduquej
Created January 24, 2017 11:18
Show Gist options
  • Save sduquej/13be3fc62445b415d49a264053e1d1b6 to your computer and use it in GitHub Desktop.
Save sduquej/13be3fc62445b415d49a264053e1d1b6 to your computer and use it in GitHub Desktop.
Em.computed.alias
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
bool1: true,
bool2: Ember.computed.alias('bool1'),
actions: {
toggleBool2() {
this.toggleProperty('bool2');
}
}
});
<h1>Welcome to {{appName}}</h1>
<br>
1: {{bool1}}
<br>
2: {{bool2}}
<br>
<button {{action 'toggleBool2'}}>Toggle 2</button>
{
"version": "0.11.0",
"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.10.2",
"ember-data": "2.11.0",
"ember-template-compiler": "2.10.2",
"ember-testing": "2.10.2"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment