Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui-router won't honer strictDi for resolves under angular 1.4 #3678

Closed
1 of 3 tasks
tomyam1 opened this issue Apr 12, 2018 · 1 comment · May be fixed by Matthelonianxl/lisk-explorer#1, maxiplux/mum.cs425.project#5 or maxiplux/mum.cs425.project#7

Comments

@tomyam1
Copy link

tomyam1 commented Apr 12, 2018

This is a (check one box):

  • Bug Report
  • Feature Request
  • General Query

My version of UI-Router is: 1.0.15

Bug Report

ui-router won't force strictDi when for resolves when running under angular 1.4

Expected Behavior:

ui-router

Link to Plunker or stackblitz that reproduces the issue:

https://plnkr.co/edit/zvCnOAJJMEOfglpgpcG3?p=preview

Click on the "Home" link and see that the state resolves correctly using the "noDeps" resolve which has no strictDi.

When running using angular 1.5.11 / 1.6.9 it throws correctly:

angular.js:68 Uncaught Error: [$injector:strictdi] noDeps is not using explicit annotation and cannot be invoked in strict mode
http://errors.angularjs.org/1.5.11/$injector/strictdi?p0=noDeps
    at VM5048 angular.js:68
    at Object.annotate (VM5048 angular.js:4005)
    at VM4917 angular-ui-router.js:8782
    at Array.forEach (<anonymous>)
    at runBlock (VM4917 angular-ui-router.js:8782)
    at Object.invoke (VM5048 angular.js:4771)
    at VM5048 angular.js:4578
    at forEach (VM5048 angular.js:325)
    at createInjector (VM5048 angular.js:4578)
    at doBootstrap (VM5048 angular.js:1809)

This seems to happen because you use the .strictDi property to test if an injector user strict DI.
But it was added on 1.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment