Why doesn't my HTTP get work on pull to refresh?

Hi guys,
I’m trying to get my HTTP.get to work on my pull to refresh. It’s having trouble receiving items from the url. I’ll place all my code related to my HTTP below. If anyone could help me out i would be very grateful. Thanks.



<html ng-app="ionicApp">
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

    <title>Ionic Pull to Refresh</title>

    <link href="http//code.ionicframework.com/nightly/css/ionic.css" rel="stylesheet">
    <script src="http//code.ionicframework.com/nightly/js/ionic.bundle.js"></script>
    <script src="js/controllers.js"></script>
  <body ng-controller="MyCtrl">
    <ion-header-bar class="bar-positive">
      <h1 class="title">Pull To Refresh</h1>
	<ion-view view-title="Announcements">
      <ion-refresher on-refresh="doRefresh()">
        <ion-item ng-repeat="item in items">{{announcement_name}} {{date}} {{message}}</ion-item>



angular.module('myApp', ['ionic'])

    .controller('MyCtrl', function($scope, $http) {
      $scope.items = [1,2,3];
      $scope.doRefresh = function() {
         .success(function(newItems) {
           $scope.announcement_name = newItems.announcement_name;
           $scope.date = newItems.date;
           $scope.message = newItems.message;
         .finally(function() {
           // Stop the ion-refresher from spinning
         myApp.error(function(newItems) {
    		alert("something went wrong");



    	"announcement_name": "Testing"
    	"date": "16/05/2015"
    	"message": "Test"

Have you seen this post?


I’ve got some news. It’s really odd. The HTTP Get will work when i’m running it via the ionic app. ‘Ionic upload’ but won’t work when i’m running it on my computer via the web browser or when i download the application onto my phone. Very strange. Any idea why?? I’ve done what it says on that website link and i still get the same results.

If you’re running in Chrome, you should be able to bring up the developer console and see the requests/responses under the Network tab.

Thanks for the response. I found out that the issue was because i needed to import some permissions into my android application.

Can you tell us, which permissions you added and what went wrong?
thanks in advance

These are all the permission I’ve added

 <uses-permission android:name="android.permission.INTERNET" /> 
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> 
  <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> 
  <uses-permission android:name="android.permission.INTERNAL_SYSTEM_WINDOW" /> 
  <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />