Skip to content

Commit

Permalink
fix(resolve): Detect and honor strictDi in angularjs versions 1.3 and…
Browse files Browse the repository at this point in the history
… 1.4

Closes #3678
  • Loading branch information
christopherthielen committed Jun 20, 2018
1 parent cd426e5 commit 1368c18
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,15 @@ function runBlock($injector: IInjectorService, $q: IQService, $uiRouter: UIRoute
services.$injector = $injector;
services.$q = <any>$q;

// https://github.com/angular-ui/ui-router/issues/3678
if (!$injector.hasOwnProperty('strictDi')) {
try {
$injector.invoke(function(checkStrictDi) {});
} catch (error) {
$injector.strictDi = !!/strict mode/.exec(error && error.toString());
}
}

// The $injector is now available.
// Find any resolvables that had dependency annotation deferred
$uiRouter.stateRegistry
Expand Down

0 comments on commit 1368c18

Please sign in to comment.