Created
October 21, 2014 21:56
-
-
Save xcarpentier/81131e03d82a6f5a804a 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
/* A éviter */ | |
function Avengers(dataservice) { | |
var vm = this; | |
vm.avengers = []; | |
vm.title = 'Avengers'; | |
dataservice.getAvengers().then(function(data) { | |
vm.avengers = data; | |
return vm.avengers; | |
}); | |
} | |
/* Recommandé */ | |
function Avengers(dataservice) { | |
var vm = this; | |
vm.avengers = []; | |
vm.title = 'Avengers'; | |
activate(); | |
//////////// | |
function activate() { | |
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