Skip to content

Instantly share code, notes, and snippets.

@KTKate
Forked from rwjblue/application.controller.js
Last active August 31, 2015 02:45
Show Gist options
  • Save KTKate/a0bfc1075968399b6813 to your computer and use it in GitHub Desktop.
Save KTKate/a0bfc1075968399b6813 to your computer and use it in GitHub Desktop.
Why Won't my component click
import Ember from 'ember';
let uuid = 0;
export default Ember.Controller.extend({
didIClick: 'No Clicks!',
actions:{
controllerClicked(){
this.set('didIClick', 'Clicked!! ' + (uuid++));
}
}
});
import Ember from 'ember';
export default Ember.Route.extend({
actions: {
otherAction(){
alert('route action');
}
}
});
<table class='hoverable bordered'>
<thead>
<tr class='active'>
<th>oh</th>
<th>hey</th>
<th>there</th>
<th>yo</th>
</tr>
</thead>
<tr>
<td>OUTSIDE</td>
{{pseudo-row clicked=(action 'controllerClicked') }}
</tr>
</table>
<br />
<h4>Click the purple component</h4>
{{didIClick}}
import Ember from 'ember';
export default Ember.Component.extend({
tagName: '',
});
<td {{action 'controllerClicked'}} class='deep-purple lighten-5'>Stuff</td>
<td {{action 'clicked'}} class='deep-purple lighten-5'>and</td>
<td {{action 'clicked'}} class='deep-purple lighten-5'>things</td>
{
"version": "0.4.9",
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.9/ember.js",
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.11/ember-data.js",
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.9/ember-template-compiler.js",
"materialize": "https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.0/css/materialize.min.css"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment