Skip to content

Instantly share code, notes, and snippets.

@kumkanillam
Last active October 6, 2016 04:20
Show Gist options
  • Save kumkanillam/ad2603194576c5799290ca9cc4f0211d to your computer and use it in GitHub Desktop.
Save kumkanillam/ad2603194576c5799290ca9cc4f0211d to your computer and use it in GitHub Desktop.
import Ember from 'ember';
export default Ember.Component.extend({
actions:{
getIdAndValue: function(value){
//this._super(...arguments);
console.log("element count " , this.$('input').length);
console.log(" first element:",this.$('input')[0]);
console.log(" first element id ",$(this.$('input')[0]).attr('id'));
console.log(" second element:",this.$('input')[1]);
console.log(" second element id ",$(this.$('input')[1]).attr('id'));
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
});
<h1>Welcome to {{appName}}</h1>
<br>
{{my-component }}
<br>
{{outlet}}
<br>
<br>
{{input click=(action "getIdAndValue") type="range" min="0" max="100" value="flow_q1"}}
{{input click=(action "getIdAndValue") type="range" min="0" max="100" value="flow_q2"}}
{{yield}}
{
"version": "0.10.5",
"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.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment