This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Wrong $resource URL when parameter is int==0 #1212
Closed
Description
If resource.userId === 0
$resource('/users/:userId/', {}, {save: {method: 'POST'}}).$save()
calls the wrong url '/users' instead of '/users/0' since userId === 0 is treated as false during uri segment encoding.
I believe it should be checked agains 'undefined' and null instead.
Version 1.0.1
File: angular-resource.js (292)
encodedVal = encodeUriSegment(params[urlParam] || self.defaults[urlParam] || "");
Metadata
Metadata
Assignees
Labels
No labels