What is the best practice while creating Angular JS service methods. To accept multiple parameters or as a object.
var getMessages = function (appid, userId,limit) {
var data = {
"appid": appid,
"userId": userId,
"limit": limit,
}
// Call rest api using data variable
}
OR
var getMessages = function (data) {
// Call rest api using data variable
}
This is best practice ever....
var getMessages = function (appid, userId,limit) {
var data = {
"appid": appid,
"userId": userId,
"limit": limit,
}
// Call rest api using data variable
}