Skip to content

Instantly share code, notes, and snippets.

@sbatson5
Created October 26, 2015 15:38
Show Gist options
  • Save sbatson5/eccae8f42942c0666a7d to your computer and use it in GitHub Desktop.
Save sbatson5/eccae8f42942c0666a7d to your computer and use it in GitHub Desktop.
Type fast - no cap
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{test-input}}
<br>
<br>
import Ember from 'ember';
const {
Component,
computed,
get,
set
} = Ember;
export default Component.extend({
inputField: computed({
get() {
return 50;
},
set(key, value) {
if (value > 100) {
value = 100;
}
return value;
}
})
});
<label>test input</label>
{{input value=inputField}}
<p>this should cap at 100</p>
{
"version": "0.4.14",
"EmberENV": {
"FEATURES": {}
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.1.0/ember.debug.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.1.0/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/2.1.0/ember-template-compiler.js"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment