Created
March 3, 2014 20:22
-
-
Save mbritton/9333781 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Provides a CRUD interface to People | |
| */ | |
| app.factory('servicePeople', function ($rootScope) { | |
| var peopleData = { | |
| people: [ | |
| { | |
| personID:1, | |
| departmentID:4, | |
| firstName:'John', | |
| lastName:'Lennon', | |
| phone:'', | |
| email:'', | |
| image:'images/appointment_john.png' | |
| }, | |
| { | |
| personID:2, | |
| departmentID:3, | |
| firstName:'Paul', | |
| lastName:'McCartney', | |
| phone:'', | |
| email:'', | |
| image:'images/appointment_paul.png' | |
| }, | |
| { | |
| personID:3, | |
| departmentID:2, | |
| firstName:'George', | |
| lastName:'Harrison', | |
| phone:'', | |
| email:'', | |
| image:'images/appointment_george.png' | |
| }, | |
| { | |
| personID:4, | |
| departmentID:1, | |
| firstName:'Ringo', | |
| lastName:'Starr', | |
| phone:'', | |
| email:'', | |
| image:'images/appointment_ringo.png' | |
| }, | |
| ] | |
| }; | |
| peopleData.getPersonByID = function(id) { | |
| var pers; | |
| $.each(this.people, function(index, itm) { | |
| if (itm.personID == id) { | |
| pers = itm; | |
| } | |
| }); | |
| return pers; | |
| }; | |
| return peopleData; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment