ngResource removes the / final

1

I am learning

asked by toledano 21.08.2016 в 02:28
source

1 answer

1

The diagonal or slash / is automatically removed because ngResource has a provider called $resourceProvider that controls whether this diagonal should be included or not.

To disable this automatic change, simply change the stripTrailingSlashes setting in some config of your application.

(function(){
  'use strict';
  resourceConfig.$inject = ['$resourceProvider'];

  function resourceConfig($resourceProvider){
      $resourceProvider.defaults.stripTrailingSlashes = false;
  }

  angular.module('cmi')
    .config(resourceConfig);
})();
    
answered by 22.08.2016 / 14:38
source