Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
la solicitud ajax está en bucle en Angularjs

Hola, estoy desarrollando la aplicación Angularjs. Estoy haciendo una llamada ajax al servidor para obtener algunos detalles. La solicitud es POST. El código escrito para Ajax está en bucle y no se detiene.

 (function () { angular.module('RoslpApp').controller('ChangePassword', ['$scope', '$http', '$translatePartialLoader', '$translate', '$state', '$stateParams', 'cfg', 'toastr', function ($scope, $http, $translatePartialLoader, $translate, $state, $stateParams, cfg, toastr) { var url = cfg.Baseurl + "api/Customer/ResetPassword"; // alert(SomeFactory.getData()); var url = cfg.Baseurl + "api/Customer/ModifyPassword"; var ID = $stateParams.LoginID; debugger; //this loops and never stops $scope.changePassword = function () { var resetpassword = { ID: ID, NewPassword: $scope.otpnewpassword }; $http.post(url, resetpassword).then(function (response) { }, function (error) { }); } }]); })();

Este es mi código html.

 <div class="body-wrapper background-pattern"> <div class="form-wrapper"> <div class="form-container"> <h2 class="form-header">Change Password</h2> <div class="form-row"> <div class="inputblock"> <span class="input-icon"><img src="images/lock-icon.png"></span> <input type="password" class="with-icon" placeholder="New Password" ng-model="newpassword"> </div> <div class="inputblock"> <span class="input-icon"><img src="images/lock-icon.png"></span> <input type="password" class="with-icon" placeholder="Confirm Password"> </div> </div> <div class="button-container"> <input type="button" value="Change Password" id="input-submit" ng-bind="changePassword()"> <input type="submit" value="Cancel" id="input-cancel"> </div> </div> </div> </div>

No estoy seguro de por qué la llamada Ajax está en bucle. ¿Puedo obtener ayuda aquí para arreglar esto? Cualquier ayuda sería apreciada. Gracias.

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Está utilizando ng-bind con una función, el atributo ngBind le dice a AngularJS que reemplace el contenido de texto del elemento HTML especificado Intente ng-click en lugar de eso.

 <input type="button" value="Change Password" id="input-submit" ng-bind="changePassword()">

a

 <input type="button" value="Change Password" id="input-submit" ng-click="changePassword()">
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!