mercredi 9 décembre 2015

How to dislay html string using Em.String.htmlSafe?

My requirement is list all customers one by one in newline.

let customers = [ {id: 1, name: "a"}, {id: 2, name: "b"}]

let displayString = customers.mapBy("name").join("</br>");

displayString = Ember.String.htmlSafe(displayString);

Now I doing like this. The problem is if the customer name has any html tags in the name, that is also rendering. How to avoid this?

Thanks, NkS




Aucun commentaire:

Enregistrer un commentaire