Skip to content

Instantly share code, notes, and snippets.

@stefanpenner
Last active November 5, 2016 18:01
Show Gist options
  • Select an option

  • Save stefanpenner/deec988d9272474f8ef1694c6dffaaff to your computer and use it in GitHub Desktop.

Select an option

Save stefanpenner/deec988d9272474f8ef1694c6dffaaff to your computer and use it in GitHub Desktop.
issue-14578
import Ember from 'ember';
export default Ember.Controller.extend({
init() {
this._super(...arguments);
this.a = 1;
this.b = 0.5;
},
abs: Ember.computed('a', 'b', function() {
return Math.min(this.get('a'), this.get('b'));
}).readOnly()
});
min: {{abs}} <br>
a:
<input value={{a}}
type='number'
onchange={{action (mut a) value='target.value'}} >
b:
<input value={{b}}
type='number'
onchange={{action (mut b) value='target.value'}} >
{
"version": "0.10.6",
"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.9.0",
"ember-data": "2.9.0",
"ember-template-compiler": "2.9.0",
"ember-testing": "2.9.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment