Skip to content

Instantly share code, notes, and snippets.

@paddyobrien
Created February 25, 2016 15:41
Show Gist options
  • Save paddyobrien/62cad5b8fcad3fa0f404 to your computer and use it in GitHub Desktop.
Save paddyobrien/62cad5b8fcad3fa0f404 to your computer and use it in GitHub Desktop.
Computed.or
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
apple: undefined,
fruit: Em.computed.or('banana', 'apple')
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{fruit}}
<br>
<br>
{
"version": "0.6.0",
"EmberENV": {
"FEATURES": {}
},
"options": {
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "1.12.2",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.3.3/ember-data.js",
"ember-template-compiler": "1.12.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment