Skip to content

Commit 9a0665d

Browse files
committed
people service
1 parent 0a1626b commit 9a0665d

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/**
2+
* User Details Service
3+
*
4+
* @factory peopleService
5+
* @namespace peopleService
6+
* @memberOf riccardo
7+
* @return {object}
8+
* @description
9+
* This service is used to get the people and the person details.
10+
*/
11+
12+
(function () {
13+
'use strict';
14+
15+
angular.module('riccardo').factory('peopleService', peopleService);
16+
17+
peopleService.$inject = ['$http'];
18+
19+
function peopleService($http) {
20+
var service = {};
21+
22+
service.getPeople = getPeople;
23+
24+
return service;
25+
26+
/**
27+
* @name getPeople
28+
* @function getPeople
29+
* @memberOf riccardo.peopleService
30+
* @description
31+
* Get the people.
32+
*/
33+
function getPeople() {
34+
// Preparing parameters object for the Http request
35+
var httpParam = {
36+
method: 'GET',
37+
url: 'data/people.json'
38+
};
39+
40+
// Http request
41+
return $http(httpParam);
42+
}
43+
}
44+
}());

0 commit comments

Comments
 (0)