diegopamio / angular-sails-bind

An angular service to bind scope models to sailsjs models thru socket
MIT License
136 stars 25 forks source link

Added support for prefix in the route of the model #17

Closed rmarku closed 10 years ago

rmarku commented 10 years ago

Now when a prefix is used in blueprints, we can call sails bind with the prefix in the resourceName. The resourceName can have the prefix string added, and the array created in $scope, will have the name of the endpoint only.

example. Insted of calling $sailsBind.bind("item", $scope, {"name": {"contains": "Foo"}};

if I configure the prefix in blueprints.js with " prefix: '/api' ", now I can call sailsBind like

$sailsBind.bind("api/item", $scope, {"name": {"contains": "Foo"}};

I has copy/pasted the test and changed the resourceName to test this. I dont know if there is a better/cleaner weay.

diegopamio commented 10 years ago

Awesome, thanks for contributing!