EmberJS – Escaping HTML Content

  • Post author:
  • Post category:EmberJS
  • Post comments:1 Comment
Escape

You can escape the HTML tags while displaying the result.

Syntax

export default Ember.Helper.helper(function(params) {
   //code here
}

Example

The example given below will escape the HTML tags. Create a new helper eschtmlcontent and add the following code to it −

import Ember from 'ember';

export default Ember.Helper.helper(function(param) {
   return Ember.String.htmlSafe(`<i><b>${param}</b></i>`);
});

Open the index.hbs file and write the following code −

Hello...Welcome to {{eschtmlcontent "Adg-lob"}}
{{outlet}}

Previous Page:-Click Here

This Post Has One Comment

Leave a Reply