Skip to content

Instantly share code, notes, and snippets.

@marcuswoy
Last active December 20, 2016 17:07
Show Gist options
  • Save marcuswoy/50da8205ff23cba80337e3ef3cc6c3a1 to your computer and use it in GitHub Desktop.
Save marcuswoy/50da8205ff23cba80337e3ef3cc6c3a1 to your computer and use it in GitHub Desktop.
Input Example
import Ember from 'ember';
export default Ember.Component.extend({
tagName:'input',
attributeBindings:['type','style','value'],
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
width:100,
actions:{
setWidth(value){
console.log(value);
}
}
});
<h1>Welcome to {{appName}}</h1>
{{outlet}}
<form {{action 'setWidth' width on='submit'}}>
{{input-helper value=width class="form-control" style="width:50px; color:black"}}
</form>
<!-- Console.log shows only the value 100 after change to 200-->
<!-- Possible to use two-way-bindings with component values?-->
<!-- I Have to use the input-helper component, because i have to use styles-->
{
"version": "0.10.7",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min.js",
"ember": "beta",
"ember-data": "beta",
"ember-template-compiler": "beta",
"ember-testing": "beta"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment