All Questions

38
votes
2answers
20786 views

Why are angular $http success/error methods deprecated? Removed from v1.6?

The angular documentation has a Deprecation Notice for the $http success and error methods. Is there a specific reason this abstraction was removed from the library?
111
votes
4answers
276288 views

How to enable CORS in AngularJs

I have created a demo using JavaScript for Flickr photo search API. Now I am converting it to the AngularJs. I have searched on internet and found below configuration. Configuration: myApp.config(...
1
votes
2answers
590 views

Binary files corrupted - How to Download Binary Files with AngularJS

download any file using ResponseEntity with angular does not work I need to download a file using angular in client side, this file can have any format it could be a pdf or excel or image or txt ... ...
67
votes
9answers
121061 views

The 'Access-Control-Allow-Origin' header contains multiple values

I'm using AngularJS $http on the client side to access an endpoint of a ASP.NET Web API application on the server side. As the client is hosted on a different domain as the server, I need CORS. It wor...
43
votes
9answers
153286 views

AngularJS not detecting Access-Control-Allow-Origin header?

I am running an angular app on a local virtualhost (http://foo.app:8000). It is making a request to another local VirtualHost (http://bar.app:8000) using $http.post. $http.post('http://bar.app:8000/m...
98
votes
6answers
134909 views

Using success/error/finally/catch with Promises in AngularJS

I'm using $http in AngularJs, and I'm not sure on how to use the returned promise and to handle errors. I have this code: $http .get(url) .success(function(data) { // Handle data ...
12
votes
2answers
25706 views

Angular Js - set token on header default

Im trying to add a header with my access token to each API call. It works well for all the GET requests, but as soon as I try to make a POST the header isn't added. Here is how I add the token: app...
7
votes
1answers
1633 views

AngularJs get blob with $http.get and extract type from response

I have webApi return me a blob file that I have to display. how can I know what type is the blob that I got? It could be anything, pdf, doc, jpeg etc. $http({ method: 'GET', url: (itemsUrl), response...
0
votes
2answers
2198 views

How to download a zip file in AngularJS / FilesaverJS

i have a service function which return me 3 result files(2 text files, 1 zip file). i want to check the header of the response to see if the file is a zip or a text to set the right configuration to ...
18
votes
2answers
10934 views

How can we test non-scope angular controller methods?

We have few methods in Angular Controller, which are not on the scope variable. Is anyone know, how can we execute or call those methods inside jasmine test? Here is main code. var testController ...

Previous Next