Thank you, maybe i should write a book:
Programming concepts in the world of astrophysics ^^
I has a json file but it not showing in exact html format, showing only the json data! I need the docode to HTML, Please help me:
here is json file:
http://addaonline.in/json-page-content/?id=69
My HTML:
ng-bind-html=“names”
My script:
.controller(‘PlaylistsCtrl’, function($scope, $ionicModal, $timeout, $ionicSlideBoxDelegate, $ionicHistory, $http, $sce, $sanitize) {
$scope.getData = function() {
$http.get(“http://addaonline.in/json-page-content/?id=544”)
.success(function (response) { $scope.names = $sce.trustAsHtml(response.content);
return $sce.trustAsHtml(response.content);
})
}
});
you have to decode the special html entities on your own.
look at this plunker: http://plnkr.co/edit/9iNnRC7AxFptnQZLPtYR?p=preview
add your html content with ng-bind-html to your dom:
ng-bind-html="yourScopeVariableWithContent"
use $sce-Service in your controller, to be allowed to print this html without stripping unwanted content:
app.controller("htmlChar", ["$scope", "$sce", function($scope, $sce) {
$scope.yourScopeVariableWithContent = $sce.trustAsHtml("© Acme");
}]);
I have already do that!!