dashboard.service.js 1.13 KB
(function() {
  'use strict';

  angular.module('acuefuel')
      .service('FBOAdmin', ['$rootScope', '$q', '$http', 'BE', FBOAdmin])

   function FBOAdmin($rootScope, $q, $http, BE) {

        this.registerUser = function(data) {

          var deferred = $q.defer();
          $http({
              method : 'POST',
              url : BE.url +'/account/user/registration',
              headers : {'Content-Type': 'application/x-www-form-urlencoded'},
              data : data
          })
          .success(function(result) {
              deferred.resolve(result);
          }).error(function(error){
            deferred.reject(error);
          })
          return deferred.promise;
        }

        this.featureControl = function(data) {

          var deferred = $q.defer();
          $http({
              method : 'POST',
              url : BE.url +'/account/user/accountFeatureControl',
              headers : {'Content-Type': 'application/json'},
              data : data
          })
          .success(function(result) {
              deferred.resolve(result);
          })
          return deferred.promise;
        }
   }

})();