【发布时间】:2014-03-05 13:49:00
【问题描述】:
我正在使用 polymer-jsonp 执行 JSONP 请求,但响应有时包含 html。
例如,假设 post.content 是 "<strong>Foo</strong> bar",我如何显示 {{post.content}} 以使 "Foo" 以粗体显示?
<polymer-element name="feed-element" attributes="">
<template>
<template repeat="{{post in posts.feed.entry}}">
<p>{{post.content}}</p>
</template>
<polymer-jsonp url="url" response="{{posts}}"></polymer-jsonp>
</template>
<script>
Polymer('feed-element', {
created: function() { },
attached: function() { },
detached: function() { },
attributeChanged: function(attrName, oldVal, newVal) { }
});
</script>
</polymer-element>
【问题讨论】:
-
你可以轻松做到: > stackoverflow.com/questions/30678307/… (Peter)
标签: javascript json polymer