Wednesday, 15 June 2011

json - Rendering html numbers and escaped characters with angular js -



json - Rendering html numbers and escaped characters with angular js -

i'm using ng-repeat directive show list of posts, retrieved through wordpress-json-api.

i have problems characters, output of wp-json-api escapes of them.

myjson :

{ "id": 1, "type": "mynicetype", "slug": "myniceslug", "title": "it’s unusual char" //my apostrophe got changed ... }

and markup:

<li ng-repeat="post in menu.posts | filter:searchtext | filter:query" > <h4 >name : {{post.title}}</h4> </li>

get rendered (obviously-awfully) as

name : it&#8217;s unusual char

what's best approach formatting these html numbers? (before assigning json.success info scope or, more easily, on fly, within template? how?)

(btw don't reason why apostrophe should receive special treatment json-api, misunderstanding here)

thanks clarification

json angularjs htmlspecialchars

No comments:

Post a Comment