Skip to content

Instantly share code, notes, and snippets.

@alexdiliberto
Last active September 7, 2017 16:47
Show Gist options
  • Save alexdiliberto/9da214f0f7e16f84041b3bee2fc1c055 to your computer and use it in GitHub Desktop.
Save alexdiliberto/9da214f0f7e16f84041b3bee2fc1c055 to your computer and use it in GitHub Desktop.
ember-toggle not working inside LinkComponent
import Ember from 'ember';
export default Ember.Component.extend({
classNames: ['working-click'],
click() {
alert('ember click handler');
},
actions: {
clickMe() {
alert('click closure action');
}
}
});
import Ember from 'ember';
export default Ember.Controller.extend({
val: true
});
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.test-link-to-component {
background: yellow;
}
.working-click {
background-color: grey;
cursor:pointer;
color: white;
margin-top: 10px;
text-align: center;
}
<h1>ember-toggle test</h1>
<p><b>NOTE:</b> <a href="https://github.com/knownasilya/ember-toggle">ember-toggle</a> not working inside LinkComponent</p>
<br>
<p>
<i>Normal x-toggle:</i>
{{x-toggle value=val onToggle=(action (mut val))}}
<small>click on me and I toggle both</small>
</p>
<hr>
<p>
<i>x-toggle inside LinkComponent:</i>
{{#my-link-component "application" val=val}}
Test Link
{{/my-link-component}}
<small>click on me and I don't work</small>
</p>
<div onclick={{action "clickMe"}}>
But I trigger my click handler
</div>
{
"version": "0.12.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.12.0",
"ember-template-compiler": "2.12.0",
"ember-testing": "2.12.0"
},
"addons": {
"ember-data": "2.12.1",
"ember-toggle": "5.0.2"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment