janhommes / o.js

o.js - client side oData lib.
https://janhommes.github.io/o.js/example/
MIT License
241 stars 58 forks source link

Add string.format() to routes like filter #2

Closed janhommes closed 9 years ago

janhommes commented 9 years ago

Example:

//get a product list on product click
o("ProductGroup/Group").filter("Group/Parent_fk eq {0} {1} {0} {2}").route("Group?",function(data) {
            console.log(data);
            self.route("Group");
            self.groups(data);
});

If the route is Group/1/Test/x the query should return a filter like this: $filter=Group/Parent_fk eq 1 Test 1 x.