Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //System.Api
- function getData(url, params) {
- return $http({
- method: 'GET',
- url: url,
- params: params
- });
- }
- //Some user service
- function getDataForUser(userId) {
- var params = {userId: userId};
- return getData('/user', params);
- }
- //Some user controller
- User.getDataForUser(userId).then(userSuccessHandler, userErrorHandler);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement