0

I have an object that has several arrays of data, some values have encoded HTML entities (such as &). I am currently looping this data with Angular ng-repeat but of course the data is show encoded characters.

How do I go about decoding these values, looping through and decoding every value before the object is passed to ng-repeat or is there a way to decode the value during ng-repeat?

Here is an example of my object:

{
    "tags": [{
        "name": {
            "id": 18262,
            "value": "Technology & Science"
        }
    }, {
        "name": {
            "id": 18263,
            "value": "Technology & Science - Best Of"
        }
    }]
}

Carl

Acolos
  • 75
  • 2
  • 12
  • A better dupe is http://stackoverflow.com/questions/33472297/how-to-translate-html-string-to-real-html-element-by-ng-for-in-angular-2. This is angular 2 specific – Ruan Mendes Sep 20 '16 at 10:03
  • http://stackoverflow.com/questions/19975331/jquery-html-shows-html-tags-instead-of-applying-html-tags-on-the-text?noredirect=1&lq=1 – Suresh Kamrushi Sep 20 '16 at 10:04
  • Thanks for the responses - this is angularjs 1.x and also would like to try and refrain from using jquery if possible. – Acolos Sep 20 '16 at 10:14
  • The answer I was after is here - http://stackoverflow.com/questions/7394748/whats-the-right-way-to-decode-a-string-that-has-special-html-entities-in-it – Acolos Sep 20 '16 at 15:45

0 Answers0