Skip to content

Instantly share code, notes, and snippets.

@baroquon
Created March 21, 2017 13:13
Show Gist options
  • Save baroquon/4820a15862d0f7f4523bc73f1c7a7d61 to your computer and use it in GitHub Desktop.
Save baroquon/4820a15862d0f7f4523bc73f1c7a7d61 to your computer and use it in GitHub Desktop.
helper in controller
import Ember from 'ember';
import { myHelper } from '../helpers/my-helper';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
test: Ember.computed(function(){
return myHelper();
})
});
import Ember from 'ember';
export function myHelper(params/*, hash*/) {
return 'I am a HELPER!!!! Huzzah.';
}
export default Ember.Helper.helper(myHelper);
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
<br>
<br>
{{test}}
{
"version": "0.11.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.11.0",
"ember-data": "2.11.0",
"ember-template-compiler": "2.11.0",
"ember-testing": "2.11.0"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment