我有一个.json对象,然后通过ng-bind通过Angular显示:
<p ng-bind-html="paragraph" ng-repeat="paragraph in content.sections[0].pages[1].paragraphs"></p>
.json有这样的结构:
{
"header":"A",
"url":"#/us/en/a/b/c/c",
"paragraphs":[
"Something something <a class='plink' href='http://blahblah.com' target='_blank'>blah blah</a>."
]
}
代码被拉过但类被删除了。控制台没有错误。
如何将课程附加到该链接?
答案 0 :(得分:0)
只需要使用带引号的双引号。
像这样:
{
"header":"A",
"url":"#/us/en/a/b/c/c",
"paragraphs":[
"Something something <a class=\"plink\" href='http://blahblah.com' target='_blank'>blah blah</a>."
]
}