【发布时间】:2015-08-05 22:54:47
【问题描述】:
我有一个 php 管理员使用 ionic 框架为移动应用程序创建内容,一切正常。 但我有一个小问题。 当管理员创建内容并放置外部链接时,此链接不起作用,甚至看起来像移动应用程序中的链接。
这是我在请求页面时从 php 得到的
{
"id": "1",
"created_date": "2015-05-19 09:09:39",
"title": "Grade 12 Graduation Ceremony",
"description": "<p><a href=\"http:\/\/ais.arrowad.sch.sa\/index.php?option=com_tz_portfolio&view=article&id=249:ais-igcse,-as,-a2-and-american-diploma-overview%E2%80%8F&catid=41&Itemid=538&lang=en\">AIS IGCSE, AS, A2 and American Diploma Overview‏<\/a></P
",
"image": "1432012362.jpg",
"thumbail": "",
"lang": "all",
"date": "2015-05-19",
"timestamp": "1432044579"
}
我正在像这样打印 html: 在控制器中
angular.module('App')
.filter('to_trusted', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
在html中
<div ng-bind-html="data.content| to_trusted"></div>
所以链接不可点击,即使我尝试将链接设为 javascript“OnClick”,但问题相同
有什么帮助吗? 谢谢
【问题讨论】:
标签: javascript php jquery angularjs ionic-framework