walnut_launchpad.html/js/services/contacts.js

34 lines
1.3 KiB
JavaScript
Raw Normal View History

2017-08-08 20:54:25 +00:00
app.factory('ContactsService', [function(){
2017-08-14 18:41:55 +00:00
var contacts = [
{
id: 1,
name:'Jane Doe',
email: 'janedoe@test.com',
description:'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora, repellendus facere expedita, magni cumque, voluptas vero nulla fugit enim ullam repellat earum vitae. Porro repellendus, officia quasi, alias numquam commodi.'
},
{
id: 2,
name:'John Doe',
email: 'johndoe@gmail.com',
description: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore magnam nostrum officiis dolor delectus ipsa magni error culpa, autem sit, perferendis eligendi officia quod amet perspiciatis dignissimos omnis molestias tempore.'
},
{
id: 3,
name:'Johnny Appleseed',
email: 'jappleseed@gmail.com',
description: 'Stuff and things. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dolore magnam nostrum officiis dolor delectus ipsa magni error culpa, autem sit, perferendis eligendi officia quod amet perspiciatis dignissimos omnis molestias tempore.'
}
];
2017-08-08 06:35:11 +00:00
2017-08-14 18:41:55 +00:00
return {
list: function(){
return contacts;
},
find: function(id){
return _.find(contacts,function(contact){
return contact.id == id;
});
}
};
2017-08-08 20:54:25 +00:00
}]);