So I have got the usual routing thing, but now i would like to ask if i can redirect to a different page, but before this happens I would like to call a function.
Thats what i have so far. but its not working properly.
when('/person/remove/:Id', {
resolve: {
delay: function ($q, $route, person) {
var currentIndex = $route.current.params.Id;
var brochure = person.get(currentIndex);
person.remove(brochure);
}
},
redirectTo: '/person'
})