I have an AngularJS service that I want to initialize with some asynchronous data. Something like this:  myModule.service('MyService', function($http) {     var myData = null;      $http.get('data.json').success(function (data) {...
I have seen answers on StackOverflow where people suggest furnishing a callback function to an AngularJS service.  app.controller('tokenCtrl', function($scope, tokenService) {     tokenService.getTokens(function callbackFn(tokens) {...
I want to implement a dynamic loading of a static resource in AngularJS using Promises. The problem: I have couple components on page which might (or not, depends which are displayed, thus dynamic) need to get a static resource from the server. Onc...
This question already has an answer here:...
I want to know if it is possible to make a service call that uses $http so it returns data directly without returning a promise? I have tried to use the $q and defer without any luck.  Here is what I mean:  I have a service:  angular.module('myMo...
I'm trying to use the Pinterest JavaScript SDK to get some pin data for a project. I have a method in a Pinterest service I created that gets called in my HomeController. I tried throwing the response inside of a promise so I could put it on my H...
I have a ui-router StateProvider and need to pick between controllers & views based on external data, so I used TemplateProvider and ControllerProvider.  If I only had the TemplateProvider it all works fine, but when I add the ControllerProvider...
What's the equivalent of Angular's $q in Angular2?  Specifically, I'm looking for $q.when, which allowed you to do something like:  return $q.when(['TestResponse']);...
Angular 1.5.8 implements a $q.race() method which takes an array of promises and returns a promise which is resolves with the value of the first resolved promise.  However i am stuck with angular 1.4 for now and need some kind of functionality like a...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.