angularjs - stripTrailingSlashes in angular-resource not working -
i'm having problem using $resource in application, need pass context retrieve json file parameter $resource , final url has '%2f' instead of '/'
i read striptrailingslashes can used avoid this, can´t make work. tried using in module.config , in $resource.
i have simple plunkr show this, although in plunkr seems work '%2f'. able see network petition in console slash instead.
this code
angular .module('appmodule', ['ngresource']) .controller('appcontroller', ['$resource', function($resource) { var vm = this; var reader = $resource(':context' + '/:file.json', {}, { query: {method: 'get', params: {context: '@context', file: '@file'}} }, { striptrailingslashes: false }); function load(context, file) { console.log('resource in ' + context + '/' + file); reader.query({context:context, file:file}, function(data) { console.log('success'); vm.data = data.name; }, function(error) { console.log('error'); } ); } load('data/folder', 'test'); }])
can give me hint on i'm doing wrong? thanks.
Comments
Post a Comment