Skip to content

Instantly share code, notes, and snippets.

@xcarpentier
Created December 12, 2014 14:53
Show Gist options
  • Save xcarpentier/26b52ddebdfdf3e2f730 to your computer and use it in GitHub Desktop.
Save xcarpentier/26b52ddebdfdf3e2f730 to your computer and use it in GitHub Desktop.
angular
.module('app')
.controller('Avengers', Avengers);
/* @ngInject */
function Avengers (storageService, avengerService) {
var vm = this;
vm.heroSearch = '';
vm.storeHero = storeHero;
function storeHero(){
var hero = avengerService.find(vm.heroSearch);
storageService.save(hero.name, hero);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment