Skip to content

Instantly share code, notes, and snippets.

@mitchlloyd
Forked from tehmaestro/controllers.application.js
Last active October 3, 2016 03:10
Show Gist options
  • Save mitchlloyd/3128ba08fedb44914fb1a95e63809aa8 to your computer and use it in GitHub Desktop.
Save mitchlloyd/3128ba08fedb44914fb1a95e63809aa8 to your computer and use it in GitHub Desktop.
My twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
stableItem: {},
something: {},
actions: {
setSomething: function() {
this.set('something', {});
}
}
});
import Ember from 'ember';
let count = 0;
export function myHelper([item]) {
return count++;
}
export default Ember.Helper.helper(myHelper);
<button {{action "setSomething"}}>Set Something</button>
<br>
<br>
{{my-helper stableItem}}
<br>
<br>
{
"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": "beta",
"ember-template-compiler": "beta",
"ember-testing": "beta"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment