Closed
Description
In the last alpha I was able to access the error object in an onError hook through:
var redirect = ['$error$', function($error$) {
if ($error$ && $error$.status === 404) {
$state.go('assets');
}
}];
Now that injections are done through the transition
parameter I tried:
var redirect = function (transition) {
var $error$ = transition.injector().get('$error$');
if ($error$ && $error$.status === 404) {
$state.go('assets');
}
};
Which always produces unknown provider errors.
Is there a new way to get the error object?