hackergarten/hackergarten.github.io

Achievements - HTML not possible

Closed this issue · 6 comments

If using HTML in achievements-modal the HTML is displayed in plain text.

hg_html_achievements

Yes, I already noticed that and gave some variants of "trustAsHtml" or ng-bind-html ng-bind-html-untrusted a shot, but without luck. @victorparmar, mybe you saw a possible solution to this while implementing the feature last night? :)

Hi - so I would say that allowing html as json text is leading us down a very slippery slope. Apart from that, I will need to look into it - I'm thinking maybe use jquery to just parse it and spit out the html to the modal. I'll get back to you on this!

It's AngularJS which parses the HTML as plain text.
I'm working on a solution, but it's not working as expected.


FYI:
{{item}} is parsed as normal text
AngularJS has an attribute ng-bind-html="" which allows parsing of HTML*

*) It's not working with ng-repeat=""

Ok so I was totally off track - @madmas had the right idea but was just missing a filter as provided here: http://stackoverflow.com/questions/19415394/with-ng-bind-html-unsafe-removed-how-do-i-inject-html/19417443#19417443. It's fixed now, I'll submit pull req :)

@victorparmar how did you get the answer so fast?

I was working on it since 8-o-clock :(

@PReimers errrr I just googled it - I guess @madmas' suggestion put me on the right track :)