Using JSONP in AngularJs

Today, I have tracking down an “Access Denied” error when I came across an AngularJS that was making a Cross-Domain request. I assumed that it have a limitation with CORS (Cross-Origin Resource Sharing), so I  have found solution hear.


var app = angular.module('demoapp', ['utf8-base64']);

app.controller('democtr', ['$scope', '$http', 'base64',
    function mydemoCtrl($scope, $http, base64) {

        var url = "";
        var turl = base64.encode(url);
        var api_url = "" + "?callback=JSON_CALLBACK&url="+turl;

            $scope.realTimeData = data;
            // do this anything with data

14. June 2015 by nuruddin AngularJS, Javascript Leave a comment 2,358 views

Leave a Reply