This provides a polyfill for the
Ember.String.isHTMLSafe feature added in Ember 2.8.
ember install ember-string-ishtmlsafe-polyfill
import Ember from 'ember'; var plainString = 'plain string'; var safeString = Ember.String.htmlSafe('<div>someValue</div>'); Ember.String.isHTMLSafe(plainString); // false Ember.String.isHTMLSafe(safeString); // true
After you upgrade your application to Ember 2.8, you should remove
Addons generally support many different Ember versions, so leaving
in place for consumers of your addon is perfectly normal. When the addon no longer supports
Ember versions older than 2.8, we recommend removing
package.json and doing a major version bump.
This addon is tested against each minor Ember version starting with 1.10 through 2.8
isHTMLSafe() landed). Additionally tested against,
ember-canary. A complete list can be found in the
ember try:eachto test your addon against multiple Ember versions)
ember test --server