Skip to content

Instantly share code, notes, and snippets.

@natecavanaugh
Created January 19, 2012 19:34
Show Gist options
  • Save natecavanaugh/1642036 to your computer and use it in GitHub Desktop.
Save natecavanaugh/1642036 to your computer and use it in GitHub Desktop.
Comparing Service APIs
//Long forms:
Liferay.Service(
{
'user/get-user-by-id': {
id: 3
}
},
function(obj) {
}
);
Liferay.Service(
'user/get-user-by-id',
{
id: 3
},
function() {
}
);
//Shortest forms:
var callbackFn = function(obj) {
};
var data = {
id: 3
};
Liferay.Service(
{
'user/get-user-by-id': data
},
callbackFn
);
Liferay.Service('user/get-user-by-id', data, callbackFn);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment