I want to get an external json before the view is visible , but $ http.get not operate until this visible sight
$scope.$on('$ionicView.beforeEnter', function () {
var value = window.localStorage.getItem("url_id");
var values = value.split("//");
$scope.url_id = values[1];
$http.get(CategoriaDatos.local + $scope.url_id).then(function (resp) {
$scope.local = resp.data;
}, function (err) {
console.error('ERR', err);
// err.status will contain the status code
})
})
;