Skip to content

Instantly share code, notes, and snippets.

@jevanlingen
Last active July 31, 2018 07:34
Show Gist options
  • Save jevanlingen/ef634d37a1190f3eb6d2953771937aaa to your computer and use it in GitHub Desktop.
Save jevanlingen/ef634d37a1190f3eb6d2953771937aaa to your computer and use it in GitHub Desktop.
Html safe helper for Ember.js
import Ember from 'ember';
export default Ember.Helper.helper( params => {
return new Ember.Handlebars.SafeString(params.join(''));
});
@jevanlingen
Copy link
Author

jevanlingen commented Jul 13, 2016

Usages:
<span style={{html-safe 'font-family: "' fontFamily '"'}}>{{fontFamily}}</span>

@timothyerwin
Copy link

Awesome!

@cbou
Copy link

cbou commented Jul 31, 2018

Ember.Handlebars.SafeString is now deprecated. import { htmlSafe } from '@ember/string'; and htmlSafe(params.join('')) should be used instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment