- EmberJS Tutorial
- EmberJS - Home
- EmberJS - Overview
- EmberJS - Installation
- EmberJS - Core Concepts
- Creating and Running Application
- EmberJS - Object Model
- EmberJS - Router
- EmberJS - Templates
- EmberJS - Components
- EmberJS - Models
- EmberJS - Managing Dependencies
- EmberJS - Application Concerns
- EmberJS - Configuring Ember.js
- EmberJS - Ember Inspector
- EmberJS Useful Resources
- EmberJS - Quick Guide
- EmberJS - Useful Resources
- EmberJS - Discussion
EmberJS - Escaping HTML Content
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 "Tutorials-Point"}} {{outlet}}
Output
Run the ember server; you will receive the following output −
emberjs_template.htm
Advertisements