Skip to content

Instantly share code, notes, and snippets.

@mohamedali-s-4725
Last active July 20, 2016 14:23
Show Gist options
  • Save mohamedali-s-4725/5fab3669d65417e7c477bc866124507f to your computer and use it in GitHub Desktop.
Save mohamedali-s-4725/5fab3669d65417e7c477bc866124507f to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Component.extend({
target_id : '',
classNames: [ 'parent-comp' ],
click( e ){
this.set( 'target_id', e.target.id );
console.log(e);
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.parent-comp{
border: solid 1px;
height: 200px;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{my-component}}
{{outlet}}
<br>
<br>
<button id='comp-button'> Click me.. </button>
<br>
<br>
Target element id : {{ target_id }}
{
"version": "0.10.1",
"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.6.0",
"ember-data": "2.6.1",
"ember-template-compiler": "2.6.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment