Skip to content

Instantly share code, notes, and snippets.

@perrygovier
Created February 17, 2015 21:29
Show Gist options
  • Save perrygovier/68dcdf6fb938a53c2a5b to your computer and use it in GitHub Desktop.
Save perrygovier/68dcdf6fb938a53c2a5b to your computer and use it in GitHub Desktop.
Basic Speakers Service
angular.module('ioniChat.services',[])
.factory('Speakers', function() {
// Might use a resource here that returns a JSON array
// Some fake testing data
var speakers = [{
id: 0,
name: 'Ben Sparrow',
notes: 'Enjoys drawing things',
face: 'https://pbs.twimg.com/profile_images/514549811765211136/9SgAuHeY.png'
}, {
id: 1,
name: 'Max Lynx',
notes: 'Odd obsession with everything',
face: 'https://avatars3.githubusercontent.com/u/11214?v=3&s=460'
}, {
id: 2,
name: 'Andrew Jostlen',
notes: 'Wears a sweet leather Jacket. I\'m a bit jealous',
face: 'https://pbs.twimg.com/profile_images/491274378181488640/Tti0fFVJ.jpeg'
}, {
id: 3,
name: 'Adam Bradleyson',
notes: 'I think he needs to buy a boat',
face: 'https://pbs.twimg.com/profile_images/479090794058379264/84TKj_qa.jpeg'
}, {
id: 4,
name: 'Perry Governor',
notes: 'Just the nicest guy',
face: 'https://pbs.twimg.com/profile_images/491995398135767040/ie2Z_V6e.jpeg'
}];
return {
all: function() {
return speakers;
},
get: function(speakerId) {
// Simple index lookup
return speakers[speakerId];
}
}
})
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment