Is the colon-based template syntax for $resource's url parameter following a standard, or is it AngularJS-specific?

39 views
Skip to first unread message

Christian Balzer

unread,
Oct 13, 2015, 7:45:37 AM10/13/15
to AngularJS
Hi all!

A REST service I'm working on is sending HATEOAS links back to its AngularJS client. For a few of them, we can't provide the full URL (for lack of information), just a URI Template. We want to follow RFC 6570 (section 3.2.7, "Path-Style Parameter Expansion") [1] to do that. The syntax is {;varName,foo} which the client is supposed to expand to ;varName=bar;foo=baz

A colleague made me aware of AngularJS's documentation [2] for $resource, where a syntax with colons is used: :varName
I suppose the equivalent for that would be section 3.2.2 in that RFC (simple string expansion): {varName}, e.g. example.com/order/{orderId}/ would be example.com/order/:orderId/ in that syntax, and expand to .../order/123/

So, first of all, could the colon syntax be used for matrix parameter templates?

Secondly, is that colon syntax defined in a standard/rfc, or is it AngularJS-specific?
(The service is supposed to be client-agnostic.)

Last but not least, does AngularJS support RFC6570 out of the box?

Kind regards,

Christian

Reply all
Reply to author
Forward
0 new messages