Last active
July 31, 2018 07:34
-
-
Save jevanlingen/ef634d37a1190f3eb6d2953771937aaa to your computer and use it in GitHub Desktop.
Html safe helper for Ember.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Helper.helper( params => { | |
return new Ember.Handlebars.SafeString(params.join('')); | |
}); |
Awesome!
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
Usages:
<span style={{html-safe 'font-family: "' fontFamily '"'}}>{{fontFamily}}</span>