You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2014/05/24 11:04:57 UTC
svn commit: r1597268 -
/isis/site/trunk/content/components/viewers/restfulobjects/angularjs-tips.md
Author: danhaywood
Date: Sat May 24 09:04:57 2014
New Revision: 1597268
URL: http://svn.apache.org/r1597268
Log:
angularjs tip
Modified:
isis/site/trunk/content/components/viewers/restfulobjects/angularjs-tips.md
Modified: isis/site/trunk/content/components/viewers/restfulobjects/angularjs-tips.md
URL: http://svn.apache.org/viewvc/isis/site/trunk/content/components/viewers/restfulobjects/angularjs-tips.md?rev=1597268&r1=1597267&r2=1597268&view=diff
==============================================================================
--- isis/site/trunk/content/components/viewers/restfulobjects/angularjs-tips.md (original)
+++ isis/site/trunk/content/components/viewers/restfulobjects/angularjs-tips.md Sat May 24 09:04:57 2014
@@ -33,16 +33,14 @@ Restful Objects will expose this as acti
You can then invoke this using AngularJs' `$resource` service as follows.
- var findCustomerAction = $resource("http://localhost:8080/restful/services/customers/actions/findCustomer/invoke?:queryString");
-
+ var findCustomer = $resource("http://localhost:8080/restful/services/customers/actions/findCustomer/invoke?:queryString");
var findCustomerArgs = {
"customerName": {
"value": "Fred"
}
};
- var findCustomerArgsStringified = JSON.stringify(findCustomerArgs);
- findCustomerAction.get({queryString: findCustomerArgsStringified}, function(data) { ... } )
+ findCustomer.get({queryString: JSON.stringify(findCustomerArgs)}, function(data) { ... } )
Here the `:queryString` placeholder in the initial `$resource` constructor is expanded with a stringified version of the JSON object representing the args. Note how the `findCustomerArgs` is the same as the `"arguments"` attribute in the original link (with a value provided instead of `null`).