0

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 am 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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
NkS
  • 1,270
  • 1
  • 18
  • 28
  • 2
    Cant you use `#each` to display the names?? – acid_srvnn Dec 09 '15 at 13:25
  • Solution 1) use #each in the template as mentionned AcidBurn. Solution 2) [escape html tags](http://stackoverflow.com/questions/5499078/fastest-method-to-escape-html-tags-as-html-entities) (note the method in the question is faster than all answers). – spectras Dec 09 '15 at 14:10

0 Answers0