AngularJS tag for $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.
0
votes
3answers
19 views
How to encode URL in angularJS
I'm trying to get the data from my Rest API controller using anuglarjs http GET request. However, the params that I need to send include "." symbol which caused the URL failed. I tried to encode it ...
0
votes
4answers
17 views
Persisting Scope beyond get request in Angular
I have the following code:
$http({
method: 'GET',
url: 'http://localhost:8080/getStuff'
}).then(function successCallback(response) {
$scope.stuffData= response.data.length;
}, ...
0
votes
2answers
56 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 ...
0
votes
1answer
35 views
Angularjs inconsistent delays between $http.get and $http.post
Here is a part of the code of one of my controllers.
//service call to add record to database
//bookApi has addBook method which contains a $http.post inside
bookApi.addBook(book);
//service call ...
0
votes
2answers
40 views
How to upload files to AWS-S3 with Angular $http PUT
In my Angular application I try to upload a file to AWS-S3 with $http.put(url, file).
However it's not working, I get back a HTTP-403 Forbidden telling me that the signature s3 calculated differs ...
0
votes
1answer
44 views
Angular / Controller loading a json file fails with an exception I can not understand
sorry, maybe a stupid problem, but I am still a newbie with angular.
The code:
-- EDIT #2 -- ----- ----- ----- ----- ----- ----- -----
MyApp.controller('DataController', ['$http', function ($...
0
votes
2answers
68 views
Getting PHP AJAX response data with Angular $http Service
I'm sorry if this is repeating previous questions, but i haven't been able to find a solution which seems to work with my problem & im new to Angular.
I have an Angular form, which communicates ...
0
votes
0answers
27 views
AngularJS Display JSON data in view [duplicate]
In my module I have a service that calls $http and gets an Array of objects,
function MenuSearchService($http){
this.getMatchedMenuItems=function(searchItem){
var ...
1
vote
2answers
28 views
angularjs change rootscope after promise in a controller
I'm trying to change some $rootscope variables from within a controller after a I have received a promise from a service.
The $rootscope variables are used to set the html page title attribute etc.
...
1
vote
2answers
24 views
$http GET method Displays Blank Page
I tried to parse json using below code but it is displaying a blank page.
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http) {
$http.get("http:krispypapad....
1
vote
5answers
52 views
Chaining multiple $http.get() ng-init angularjs
Im working on a scenario where on page load i have 2 $http.get() request. One $http.get() are independent on another $http.get(). Every thing works fine.But in some situation my 2nd $http.get() ...
3
votes
3answers
59 views
angular component one-time binding from $http shows undefined
I'm new to Angular. I'm trying to use components (1.6). In the parent, I have an $http.get that gets data from a service and then assigns the response to a $scope variable. That scope variable is ...
0
votes
3answers
41 views
Getting json url links (Youtube) to show using angularjs
I'm trying to use AngularJS to get data from a json file which has video objects. However, I can only figure out based on other resources/references how to take ONE specific url and concatenate it ...
7
votes
4answers
3k views
Error with $http.get in angularJS — Success not a Function
Getting this error:
angular.min.js:122 TypeError: $http.get(...).success is not a function
at getUserInfo (app.js:7)
at new (app.js:12)
at Object.invoke (angular.min.js:43)
...
-1
votes
2answers
38 views
AngularJS - Make synchronous http request
Angular Service
this.sendCommand = function (someData) {
URL = myURL;
return $http({
method: 'POST',
url: URL,
...
0
votes
1answer
33 views
Managing data from http method in controller with AngularJS 1.5 components
Ng-repeat in component can't show data charged from $http.then in controller. What am i doing wrong?
Service calling rest method in app.js:
app.service('dataService', dataService);
function ...
1
vote
3answers
35 views
Can't assign object returned by service to $scope
I'm trying to assign data returned by service to $scope property. Somehow it doesn't work properly. The service method correctly get data via $http.get but then it is not assigned to $scope in the ...
0
votes
1answer
22 views
View No Longer Updating Immediately in Efforts to Clean Up Scope Soup
I've fallen victim to self-imposed $scope soup and am taking steps to correct this. I'm adopting some of the methods written about by Josh Carroll in his article here:
http://www.technofattie.com/2014/...
1
vote
1answer
22 views
Same data is returned in AngularJS Promise Chaining
I want to make 3 API calls when my page is loaded to bring the necessary data.
My application is in AngularJS#1.5.8. I am able to bring the data separately in service, but for some reason, in the ...
2
votes
1answer
66 views
AngularJS - Toaster not working in Controller
Service.js
this.userLogin = function (username, password) {
var dataBody = $.param({'username': username,'password': password});
return $http({
method: 'POST',
...
1
vote
1answer
32 views
Add document access denied
We've created an AngularJS 1 project and we can successfully use the search functionality using a POST. We added a controller for adding documents to an index but we keep getting the message
...
1
vote
0answers
258 views
Angularjs showing 500 internal server error on posting data to laravel routes
For some reason I'm getting a 500 interval server error when posting data from angular to laravel route.
app.js
var quora = angular.module("quora-app", ['q-controller-1', 'ngRoute', function($...
0
votes
1answer
13 views
using factory in the controller retrun undefind
i am trying to send value from my view to the controller using function inside ng-click , then use that value to pass it to my factory which goint to pull data from rest api link , but the value im ...
0
votes
1answer
49 views
How to login on a Domino server with angularjs?
I'd like to login to a Domino server from an angularjs webpage. The page itself resides in the database I want to authenticate with, so it's not really remote.
This is my code:
return $http({
...
0
votes
0answers
82 views
Internal Server error 500 in Angular + Laravel
I am developing a application using laravel and angular js. Laravel is for the api and the view is also in a blade template which includes a ng-view element.
I get this "internal server error 500" ...
-1
votes
1answer
70 views
How to check user token in Angular?
I generated token with JWT using node and angular, and can't check if user is authorized.
Node:
module.exports.authenticate = function(req, res) {
var user = new User(req.body);
User.findOne(...
1
vote
3answers
47 views
How to filter in ngTables
I am using ng-table to generate my table.
but my data has two column, the first one is an object.
My function in controller :
$scope.allServers = function() {
$http.get("/volazi/getServers")....
0
votes
0answers
51 views
AngularJS : Showing a spinner while during $http request
I put in place some routes with the $routeProvider.
The place is that some templates need some time to load because of the $http requests.
What I wanted to do is to display a spinner or a wait ...
0
votes
1answer
46 views
Angular JS $http POST not responding on success in ASP.NET MVC
I am developing an ASP.NET MVC Application. I am using Angular JS. Now what I am doing is posting data to server and getting json result from the server. But my problem now is, it sends data to server,...
0
votes
1answer
44 views
Submitting ASP.NET MVC CSRF token with $http in Angular JS
I am developing an ASP.NET MVC Web Application. I am using Angular JS. But I am having a problem with submitting post form to server because of CSRF validation. First of all, I am new to Angular JS. ...
5
votes
1answer
32 views
Encapsulating model in its own class for Angularjs app
I have 2 views. One is to list student in a table and the other is when you click on a student, it shows the details of the student. I have brought the student to it's own class in a separate file ...
1
vote
2answers
76 views
Angular $http service wait until data returned
I created this http service:
(function () {
"use strict";
angular.module("inspectionReview").factory("inspectionReviewServices", ["$http", "config", inspectionReviewServices]);
function ...
0
votes
3answers
39 views
Able to access object returned by service, but accessing its properties gives undefined
I'm an angular beginner and I'm trying to set up a factory that gets data from my php back-end and updates the controller. Here is my basic code:
factory
app.factory('sessionStatus', ['$http', ...
1
vote
2answers
106 views
Angular: $http requests gives -1 status
A node.js server gives "This is a string". (writeHeader, write( string), end).
When performing a $http request, I see that the node.js server is responding and sending the information back.
In ...
2
votes
1answer
57 views
Angular post, put, delete returns 405
I am new to angular.
I cant invoke POST, PUT and DELETE methods using angular (GETs working fine)
I have a .NET WebApi server which all methods and all resources URLs works and tested using Advanced ...
1
vote
1answer
65 views
$http timing issues, AngularJS
Have two issues. I am trying to get a value from an $http response and populate a variable with it that should then update a couple DOM objects. Problem is that it seems to be having a timing issue ...
0
votes
3answers
128 views
angularjs multiple controllers same $http request cache
Working on a application that requires multiple components to be displayed on the same page that need data from the same api url.
As per example I have two components, one is a breadcrumb one is the ...
2
votes
4answers
83 views
HTTP POST turns into OPTIONS AngularJS
I'm trying to submit a login form to a rest Api, translating my Jquery/Javascript code into AngularJS. I try to use $http service for send the request, but when I submit the form, the POST request ...
0
votes
0answers
30 views
Defining optional parameters in AngularJs http get
I have this code for HTTP get Method. I'm using currency as a parameter that is required but I would like to add optional parameters for time and date wich are also included in the API. How do I do ...
0
votes
4answers
89 views
AngularJS, how do I use a service to capture HTTP data and bind it to my controller?
I have an API call that's working great, but I'd like to use it on several controllers so I moved it to it's own service. I'm running into what looks like a classic Scope issue or a misunderstanding ...
2
votes
1answer
70 views
$state.go not working in single controller
everyone. I am having a strange problem...I have several states in my app, and they all seem to work except inside of one controller. I have posted the factory whose function I am trying to use, along ...
6
votes
3answers
485 views
Why do we prefer using $q in angular instead of $http
I am currently using $q service from angular to make API calls like this:
var deferred = $q.defer();
$http.get(config.apiHost + details.url)
.success(function (data) {
deferred.resolve(...
1
vote
1answer
119 views
AngularJS 1.5 Components printed before gets the controller values
I've a parent view with a parent controller, with 2 children component, each one with his own controller.
Something like this
<section> // Main Controller
<table-users listusers="...
1
vote
4answers
392 views
Cannot POST data to server through angularjs's $http module
I am coding using angular ajax. The client side code is:
$http({
method: 'POST',
url: '----/test.php',
data: ({'txtDeviceID': 12345678}),
headers: {
'Content-type': '...
0
votes
0answers
52 views
C Program Web API call from AngularJS $http
How I can give call to C Program Web API from AngularJS $http request?
AngularJS $http part has been already done. But I m new to C Program.
I want to know: How my $http URI and C program Web API ...
0
votes
1answer
98 views
node uploading file $http.post from angularjs has undefined req.body
I'm building a file upload functionality with my angularjs app that would upload a file to my node api that will ftp to a cdn server. Right now I'm stuck with just getting hte file. I tried using ...
0
votes
2answers
26 views
How to communicate AngularJS's $http routes and APIs developed in C Programming
I have made web application GUI using AngularJS, Bootstrap, HTML, CSS.
Backend team are developing APIs in C Programing.
So how my routes in $http request (sending from factory) will communicate to C ...
1
vote
3answers
508 views
How to skip angularjs interceptor for an HTTP request?
I have an angularjs app, in which I have an interceptor that adds the authorization token to the header of each request.
However, somewhere in the application I need to use and external API where ...
1
vote
3answers
153 views
How to assign value returned by service's $http.get() to a variable in controller?
I have created the separate service for fetching data from server, but I want to assign the data that this service returns to variable in the controllers. in this case data is a simple JSON file.
...
-1
votes
1answer
191 views
Angularjs $http post promise [duplicate]
I try to use the promise respond from a $http.post, to get back the new ID of the record as integer and use it for the next $http.post. I used How do I return the response from an asynchronous call? ...