Jack
Jack

Reputation: 1

$http.get() Method didn't work on windows 8.1 cordova

our project use angularjs $http.get() method to get JSON data. When page refresh, the method will get JSON again and get the latest data. It is working fine on android platfrom ,but it can not work on Win 8.1 application.

app.controller('ClimateMonitoringCtrl', function ($scope, $stateParams, $http, WebUrlService) {
    var location = $stateParams.location_id;
    var url = WebUrlService.url;
    $scope.avai1 = false;
    $scope.avai2 = false;
    $scope.avai3 = false;
    $http.get(url + "GetSensorCurrentData/" + location)
    .then(function (response) {
        $scope.station_no = "1309";
        $scope.sensors = response.data.GetSensorCurrentDataResult;
    });

Upvotes: 0

Views: 115

Answers (1)

Ali Esmaeili
Ali Esmaeili

Reputation: 542

Better to clarify your question , if you mean windows platform like browser on windows for security reasons it cannot execute get and post also ajax requests . see your browser log console for details :

Cross-Origin Request Blocked...

So instead of using your browser to check the app use simulator or device . You can also take advantages of WAMP Server.

hope it solve your problem

Upvotes: 0

Related Questions