Skip to content

Instantly share code, notes, and snippets.

@xcarpentier
Created October 7, 2014 11:15
Show Gist options
  • Save xcarpentier/2802200e857dbdf8889e to your computer and use it in GitHub Desktop.
Save xcarpentier/2802200e857dbdf8889e to your computer and use it in GitHub Desktop.
/**
* Recommandé
*/
function Avengers(dataservice, logger) {
var vm = this;
vm.avengers = [];
vm.getAvengers = getAvengers;
vm.title = 'Avengers';
activate();
function activate() {
return getAvengers().then(function() {
logger.info('Activated Avengers View');
});
}
function getAvengers() {
return dataservice.getAvengers().then(function(data) {
vm.avengers = data;
return vm.avengers;
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment