I have created a request http, and save this in localstorage, but…load only text…not images and videos
.controller(‘detailsCtrl’, function($scope,$http,$sce, $stateParams,$timeout,$ionicLoading,$rootScope) {
var wordpressUrl ="http://www.mysite.it/sites/wordpress/wp-json/wp/v2/posts/"+ $stateParams.pippolistId;
$ionicLoading.show({
content: 'Loading',
animation: 'fade-in',
showBackdrop: true,
maxWidth: 200,
showDelay: 0
})
// effetuo la chimamata REST API
$http.get(wordpressUrl)
// risposta positiva
.success(function(response,$timeout){
console.log("Reveived getPosts via HTTP: ", response, status);
// Loading Json
$ionicLoading.hide();
$scope.post = response;
window.localStorage.setItem("post", JSON.stringify(response));
console.log( response );
})// fine success
//risposta negativa
.error(function(response, status){
console.log("Error while received response. " + status + response);
$ionicLoading.hide();
if(window.localStorage.getItem("post") !== undefined) {
$scope.post = JSON.parse(window.localStorage.getItem("post"));
}
});// fine error
})