resetPassword.service.js 874 Bytes
(function(){
 'use strict';    
    angular.module('acufuel')
      .service('ResetPasswordService', ['$q', '$http', 'BASE_URL',  ResetPasswordService]);

      function ResetPasswordService($q, $http, BASE_URL) {        
        var temp = {};

        this.changepassword = function(password, confirmpassword) {
          var deferred = $q.defer();
          var param = 'password='+ password + '&confirmpassword=' +confirmpassword;
          $http({
             method : 'PUT',
             url : BASE_URL.url+'/user/changepassword',
             headers : {'Content-Type': 'application/x-www-form-urlencoded'},
             data: param
          }).then(function (result){
            deferred.resolve(result.data);
          },function (result){
            deferred.resolve(result.data);
          });
          return deferred.promise;
        }
      }
      
})();