angular.js icon indicating copy to clipboard operation
angular.js copied to clipboard

feat(ngRoute): screening colon in given path

Open stervets opened this issue 10 years ago • 2 comments

Use backslash symbol before colon to prevent it interpretation as variable. For example: path "/:foo/:bar" returns only "bar" variable

stervets avatar Jan 06 '15 15:01 stervets

I think that a better description of this feature is "allow colons to be escaped in route definitions". That being said, colons are reserved characters in URLs anyway. And so they should be escaped anyway as %3A. We should check that this works and then document it.

petebacondarwin avatar Jan 24 '15 10:01 petebacondarwin

According to RFC2396 - although reserved - : is allowed (unescaped) in fragments, which is what we use when in HashBang mode (currently the default). Considering that (and the fact that I couldn't make %3A work, I think it makes sense to support escaping :.

That said, we need better tests and docs.

gkalpak avatar Jun 01 '16 10:06 gkalpak