You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
extract url parsing / composing into reusable service #738
This is a nice idea, would it be a good idea to expose this service on $location and also allow parsing of url strings without actually changing the location (if you pull one from an iframe for example)?
+1
The valid use case I have is, I need to check the length of url generated for GET request before making request, as some urls generated are too long due to request params has list that grows big.
OK, so we have agreed to expose the setUrlParams function as a service on the ngResource module. We do not want to add it to the core AngularJS module as it would add unnecessary code to that file.
We've decided not to add this after all, as only a small number of people would benefit from the option to manipulate url params in resource. And we don't want to expose a general url composition service in AngularJS as core should cater specifically to the needs of the framework.
@gilbsgilbs - since we are entering LTS mode the code for manipulating the URLs internally in AngularJS is not going to change (or at least it is very very unlikely to change). So it is pretty easy and safe to copy the code from angular-resource.js and reuse it in your own applications.
Activity
witoldsz commentedon Mar 21, 2012
+1 :)
m6w6 commentedon Jul 9, 2012
+1
niklasbulitta commentedon Jul 31, 2012
+1
bsr203 commentedon Oct 6, 2012
+1
iwein commentedon Nov 12, 2012
This is a nice idea, would it be a good idea to expose this service on $location and also allow parsing of url strings without actually changing the location (if you pull one from an iframe for example)?
georgiosd commentedon Feb 26, 2013
+1
dmitryevseev commentedon Feb 28, 2013
+1
tanepiper commentedon Feb 28, 2013
+1 would love to see something as powerful as http://medialize.github.com/URI.js/ rolled into $location
snichme commentedon Mar 27, 2013
+1
brettlaforge commentedon Apr 18, 2013
+1
coli commentedon Apr 29, 2013
+1, one of my template needs this right now to massage some urls
Leksyk commentedon May 17, 2013
+1
eyelidlessness commentedon Jul 28, 2013
+1
pahlers commentedon Sep 5, 2013
I would like to have this. It can't be difficult to implement. $resource has the same system (Route.setUrlParams).
pahlers commentedon Sep 16, 2013
Made some code to solve this problem. It would be better when this was native angular code.
https://github.com/eonlepapillon/parametrizedLocation
7 remaining items
johncrim commentedon Nov 8, 2015
+1
URL is not a standard javascript class, so this really should be a core angular service, to avoid many duplicates of similar logic.
STOpandthink commentedon Jan 14, 2016
+1
tools4origins commentedon Feb 24, 2016
+1
andy-rush commentedon Mar 1, 2016
+1. Or more.
chetankhilosiya commentedon Apr 13, 2017
+1
The valid use case I have is, I need to check the length of url generated for GET request before making request, as some urls generated are too long due to request params has list that grows big.
pashchuk commentedon Jan 26, 2018
Is there any progress on this one?
panlina commentedon Mar 5, 2018
+1
petebacondarwin commentedon Mar 5, 2018
OK, so we have agreed to expose the
setUrlParamsfunction as a service on thengResourcemodule. We do not want to add it to the core AngularJS module as it would add unnecessary code to that file.feat(ngResource): add `$composeResourceUrl` service
Narretz commentedon Jul 4, 2018
We've decided not to add this after all, as only a small number of people would benefit from the option to manipulate url params in resource. And we don't want to expose a general url composition service in AngularJS as core should cater specifically to the needs of the framework.
petebacondarwin commentedon Jul 5, 2018
@gilbsgilbs - since we are entering LTS mode the code for manipulating the URLs internally in AngularJS is not going to change (or at least it is very very unlikely to change). So it is pretty easy and safe to copy the code from
angular-resource.jsand reuse it in your own applications.gilbsgilbs commentedon Jul 5, 2018
@petebacondarwin that's a neat suggestion. Thank you very much. I will opt for this (and I totally understand the decision).