Skip to content

Instantly share code, notes, and snippets.

@martin-hoger
Created April 10, 2019 12:31
Show Gist options
  • Save martin-hoger/2c83c86416c8fa185b4ddbc68004ab17 to your computer and use it in GitHub Desktop.
Save martin-hoger/2c83c86416c8fa185b4ddbc68004ab17 to your computer and use it in GitHub Desktop.
On mouse enter & leave
import Ember from 'ember';
export default Ember.Component.extend({
text: "---",
mouseEnter() {
this.set('text', '+++');
},
mouseLeave() {
this.set('text', '---');
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
{{my-component}}
<div style="padding: 20px; background: #eee; margin: 0 0 5px;">
{{text}}
</div>
{
"version": "0.15.1",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js",
"ember": "3.4.3",
"ember-template-compiler": "3.4.3",
"ember-testing": "3.4.3"
},
"addons": {
"ember-data": "3.4.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment