I am trying to link the following json response in my html page.
Json is as follows:
{
"key":{
"text":"<p>For more information, please visit <a href = \"javascript:void(0);\" ng-click = \"customizeWindow('http://www.google.com');\">Support</a> .</p>"
}
}
html page
<div ng-bind-html="message"></div>
Controller code
$http({
method: 'GET',
url:'DAYS.json'
}).success(function(responsedata) {
$scope.message=responsedata.key.text;
}).error(function(responsedata){});
configure the function of the internal window inside the controller
$scope.customizeWindow = function(url) {
window.open(url, "_blank", "toolbar=yes, scrollbars=yes, resizable=yes,top=70, left=190, width=970, height=460");
}
ng-bind-html binds the html tags, but it removes the javascript and ng-click event. I get only support when I check the item and the link is not working.
Please offer me a solution.
source
share