I want to get an external json before the view is visible and active, but $ http.get not work until the view is visible. I'm dealing with $ ionicView.beforeEnter
$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);
})
});
Once the view is active and visible the get method works and gets the data.