Questions tagged [angular-promise]

Angular's $q promises provide a powerful abstraction over flow control. If you tag your question with this tag, consider also tagging it with "promise" tag. This tag is also appropriate for questions about angular and promises not relaying to $q directly.

Angular's $q promises provide a powerful abstraction over flow control. If you tag your question with this tag consider also tagging it with the promise tag.

This tag is also appropriate for questions about angular and promises not relaying to $q directly.

2114 questions
0
votes
1 answer

Angular 2 api call promise array not resolving

I'm using Angular 2 with TypeScript and experimenting with a Facebook SDK wrapper. I need to resolve the Facebook data in a loop. Somehow my promise array is not resolving. But when I log the response from the api call, everything seems fine. So I'm…
0
votes
2 answers

Assigning variable from a factory to a control doesn't work

My html is this:
here
This is my controller: angular.module("AuthenticationApp", ["BaseApp"]) .controller("MainCtrl", ["$http",…
SilentDev
  • 20,997
  • 28
  • 111
  • 214
0
votes
4 answers

How to save a promise object as a $scope variable in Angular JS

Constants.getContants is a promise which will get all the constants that are used in my application. I would like to save this to a $scope variable so that I can access it anywhere in the controller or application. Now, whenever I need to access it,…
Anand MP
  • 121
  • 1
  • 2
  • 13
0
votes
1 answer

Firebase Array Fetches Not Loading on Page Load

// Movements Controller app.controller("MovementsCtrl", ["$scope", "$rootScope", "$filter", "$timeout", "$route", function($scope, $rootScope, $filter, $timeout, $route) { $rootScope.pageName = "Movements"; var date = new Date(); var…
Joe Berthelot
  • 725
  • 4
  • 16
  • 33
0
votes
2 answers

Angular access variable outside $http success function

I am trying to loop through some json values outside the actual function. could anyone help me? app.controller('MapCtrl', function($scope, $http){ $scope.contents = []; $http.get('/data4estate/data_model.php') .success(function(data) { …
ranaz
  • 97
  • 1
  • 10
0
votes
3 answers

Is it possible to have a default errorCallback for a promise?

Is there a way to provide a default errorCallback for a promise, such that the default errorCallback does not get called if user has provided an errorCallback. function getFoo() { // TODO magic goes here to setup defaultErrorCallback as…
Ben George
  • 975
  • 3
  • 12
  • 23
0
votes
1 answer

returning response from factory to controller

I'm currently using a factory to pass in a response to a controller. The issue that i am having...is that the response doesnt become defined until i press submit. my factory (responseHandler): return { setMessages: function(response) { …
jeremy
  • 433
  • 1
  • 8
  • 30
0
votes
2 answers

How to Return Asynchronous ($http) Data on Modal Close or Cancel

I have a open modal in controller called "Audit" $scope.comment = function (spec){ ManualService.setManual(spec); var modalInstance = $modal.open({ templateUrl: 'views/comment.html', controller:…
0
votes
3 answers

Http service delay processing until after data is returned

I work on my angularjs project. I created this service: (function () { "use strict"; angular.module("manageItems").factory("manageItemsService", ["$http", "config", manageItemsService]); function manageItemsService($http, config) { …
Michael
  • 13,950
  • 57
  • 145
  • 288
0
votes
2 answers

Angular async promise is not chaining correctly to give back 1st call in order to make 2nd call

I want to return a zipcode before I call a 2nd service, so that -- from what I thought I know -- I can wrap in a promise, and then ask for the promise later. So I figured I would just place my 2nd service inside the promise of the 1st service. But…
user6321478
0
votes
2 answers

Angular Catch method not working with $http get request

I am trying to neatly manage service function calls from the controller while handling errors from the API. However when I do the following, I still get this is showing even with 403 and 404 errors in my console even when the API throws back a 403…
Adrian
  • 1,976
  • 5
  • 41
  • 105
0
votes
2 answers

defer.promise returning same result in angularJS

I have a Service which fetch the data from API.When I am trying to call this service. It's returning with same value. appName.service('FetchCustomerDate', ['$http', '$q', function($http, $q) { var self = this; self.getCustomerData =…
Player
  • 3
  • 3
0
votes
1 answer

angular factory store promise result

I have a factory object that contain private object, which is used to cache result retrieved from the api using the factory available functions. global.mainApp.factory('SessionFactory', function (UserEndpointsResource, SiteEndpointsResource) { …
Nadav96
  • 1,274
  • 1
  • 17
  • 30
0
votes
2 answers

call function after for loop complete

I am try to call function $scope.getThisFunction($scope.Num) after completion of for loop, i tried below code but not working. Any suggestion? for(var i = 0; i < $scope.selection.length; i++) { $http({ method: "POST", …
Pratyush Pranjal
  • 544
  • 6
  • 26
0
votes
1 answer

Angular + NodeJS: Read Files From Folder With Promises (fs.fileRead and fs.readdir)

I'm trying to read files from a folder using NodeJS and Angular. I'm able to iterate through the folder and access the files data, no problems here. My main issue i that i'm unable to pass the result (array of names) to the $scope and show it to the…
Ricky
  • 2,912
  • 8
  • 47
  • 74