Skip to content

Instantly share code, notes, and snippets.

@rlivsey
Created July 29, 2016 21:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rlivsey/7721088850b8ff72b921831d160652f2 to your computer and use it in GitHub Desktop.
Save rlivsey/7721088850b8ff72b921831d160652f2 to your computer and use it in GitHub Desktop.
New Twiddle
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle',
baz: "baz"
});
import Ember from 'ember';
export function myHelper([path], options={}) {
let klass = options.class;
let svg = `<p class="${klass}">${path} (${klass})</p>`;
return Ember.String.htmlSafe(svg);
}
export default Ember.Helper.helper(myHelper);
Testing
{{my-helper "foo" class=baz}}
{
"version": "0.10.3",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "//s3.amazonaws.com/builds.emberjs.com/alpha/ember.debug.js",
"ember-data": "2.7.0",
"ember-template-compiler": "//s3.amazonaws.com/builds.emberjs.com/alpha/ember-template-compiler.js"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment