Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem with $http post in Angularjs. Any one can help on how to avoid duplicated requests... Here is my code in controller


JavaScript
var myApp = angular.module("myApp", ['ngRoute', 'pascalprecht.translate']);
myApp.controller('mainController', function ($scope, $translate, $location, $rootScope, $http, $filter, $interval) {
var myInit = function () {
            $http.post("API_V1/api.asmx/fetchALLRate", { data: {} })
                  .success(function (data, status, headers, config) {
                   this.objRate = $.parseJSON(data.d);
                   //do something...
            });
        };
angular.element(document).ready(myInit);


And here is image for duplicate request error
http://i.stack.imgur.com/5fEyy.png[^]

Thank you in advance.. hope that anyone could help me out...btw, sorry for my bad english.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900