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

Angular Type Checking not the same as previous logic #29

Open
moneymikeMD opened this issue Oct 30, 2019 · 2 comments
Open

Angular Type Checking not the same as previous logic #29

moneymikeMD opened this issue Oct 30, 2019 · 2 comments

Comments

@moneymikeMD
Copy link

Hi there,

The logic that checks whether the inputted in/out transition objects is an array/function/object has changed. Previously, you had:
dataOptsType === '[object Object]'
which would only match if the dataOpts object was truly an object. But now with this code:
angular.isObject(dataOpts)
the function runs for situations where dataOpts is an object or an array because an Array is an object with this check. This is causing the following error to occur in our production app:
Error: [$injector:strictdi] function($state) is not using explicit annotation and cannot be invoked in strict mode https://errors.angularjs.org/1.7.8/$injector/strictdi?p0=function(%24state) at angular.js:138 at Function.annotate [as $$annotate] (angular.js:4303) at injectionArgs (angular.js:5100) at Object.invoke (angular.js:5133) at angular-gsapify-router.js:130 at Array.forEach (<anonymous>) at getOpts (angular-gsapify-router.js:125) at Object.enter (angular-gsapify-router.js:195) at Function.enter (angular-gsapify-router.js:517) at executeAnimationFn (angular-animate.js:1937)

because the isArray check is fine, but the isObject check also matches and then tries to run each array element on its own, which means the second part of our array being just a function gets flagged because of the strictDI requirement.

@homerjam
Copy link
Owner

Hey! Could you submit a PR please?

moneymikeMD added a commit to moneymikeMD/angular-gsapify-router that referenced this issue Oct 30, 2019
@moneymikeMD
Copy link
Author

@homerjam sure, I can do that 😄 #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants