I'm having trouble moving my Angular 1 JavaScript service to a Angular 2 TypeScript service using http to make a CORS request (this is using Ionic version 2). In Angular 1, I do something like this.  angular.module('app.services',[]) .fac...
In AngularJS for sending a request I use the builtin $http service.   What shall I use for sending a request to a server in Angular? I can't find any doc that covers the subject....
I load some binary data using   $http.post(url, data, { responseType: "arraybuffer" }).success(             function (data) { /*  */ });   In case of an error, the server responds with an error JSON object like  { "message" : "som...
I'm working on an angularJS app and this is my first website using this framework. In my app i've a need to make a $http call inside a for loop. With in the loop before the next iteration I want to wait for the response from my previous call....
I have a ng-repeat loop for a number of values. While looping, I fetch a variable from another array of values and use that:  <div ng-repeat="i in [1,2,3]">     <div ng-init="obj = getObject(i)">         <pre>{{ obj...
In angular app I have an array of literal objects containing a url property. I need to make a http request for each of these object, but one after another.  example:  let arr = [{url: 'http://example.com/url1'},{url: 'http://example.com/u...
When I get an element from id in Angular I get this error  message: "Cast to ObjectId failed for value \"${id}\" at path \"_id\" for model \"Projet\""   Data Model  export interface NouveauProjet {   _id: String;   lea...
I have 2 examples of using query in AngularJS:  First :   requests.query().$promise.then(function(requestResponse) {     myFunction(requestResponse); });   Second :  requests.query(function(requestResponse) {     myFunction(requestResponse); });   Ar...
My Code is:  $rootScope.getResource = function(id) {   $http.get( "path/of/resource/" + id )     .success(function (data, status, header, config) {     return data;   })     .error(function (data, status, header, config) {     console.log(...
I'm performing a GET - request on my back end to retrieve some JSON - data. I want to store a part of the data in a variable because I want to use it after the request. But everytime, the variable is undefined while I did the same thing in anothe...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.