Hi Sander,

As per your suggestion  i track my application and get the error regarding
to CORS and
error is .

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at http://localhost:2383/WebService1.asmx. This can be
fixed by moving the resource to the same domain or enabling CORS.

To solve this i  insert a following  code in my application.

 var app = angular.module('myApp', [])
    app.config(function ($httpProvider) {
        $httpProvider.defaults.withCredentials = true;
        $httpProvider.defaults.useXDomain = true;
        delete $httpProvider.defaults.headers.common['X-Requested-With'];
    });

    app.controller('ctrl1', ['$scope', '$http', 'dataService', function
($scope, $http, dataService) {
        $scope.testVar = "hello";

        dataService.dataSearch().then(function (dataResponse) {
            $scope.data = dataResponse;
            console.log('hello');
        });

    }]);
    app.service('dataService', function ($http) {
        delete $http.defaults.headers.common['X-Requested-With'];

        this.dataSearch = function () {
            return $http({
                method: 'GET',
                url: 'http://localhost:2383/WebService1.asmx',
                headers: {
                    'Authorization': '31BF3856AD364E35'
                }
            });
        }
    });


still i get following message  as warning and do not get a output as i
expect

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the
remote resource at http://localhost:2383/WebService1.asmx. This can be
fixed by moving the resource to the same domain or enabling CORS.


Regards,
Gaurav

On Mon, Mar 23, 2015 at 7:04 PM, Sander Elias <[email protected]> wrote:

> Hi Gaurav,
>
> Are you serving up your html from the same server as the web-service is
> housed? If not, you probably have an CORS issue (seek in this group for
> solutions about that)
> If it is not CORS, you have ate least give us the error you are
> experiencing. have a look at the developers console.
>
> Regards
> Sander
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/AFuudQjvji4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Regards,
Gaurav  Raut

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to