I have a php admin to create content for a mobile application using ionic framework, everything works perfectly. but I have a little problem. when the admin create a content and put an external link, this link is not working, even it looks like a link in the mobile application.
This is what I get from the php when requesting the page
{
"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"
}
I am prining the html like this : in the controller
angular.module('App')
.filter('to_trusted', ['$sce', function($sce){
return function(text) {
return $sce.trustAsHtml(text);
};
}]);
and in the html
<div ng-bind-html="data.content| to_trusted"></div>
so the link is not clickable, even I tried to make the link as a javascript "OnClick" but its the same problem
any help ? Thanks
Look how your link is rendered:
"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
The closing tags are broken:
<\/a></P
A normal html link should look like for example:
<a href="www.example.com">This is my link</a>