-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(upgrade): propagate return value of resumeBootstrap #22754
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
Conversation
|
||
const value = (<any>window).angular.resumeBootstrap(); | ||
expect(value).toBeDefined(); | ||
expect(value.invoke).toBeDefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also assert that this is the same as ref.ng1Injector
(or angular.element(element).injector()
)?
|
||
const value = (<any>window).angular.resumeBootstrap(); | ||
expect(value).toBeDefined(); | ||
expect(value.invoke).toBeDefined(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also assert that this is the same as upgrade.$injector
(or angular.element(element).injector()
)?
(The bootstrap
helper returns a promise that is resolved to upgrade
.)
Also, linting fails 😱 (Running |
f945f75
to
6b7bf7e
Compare
I think this is ready... |
const value = (<any>window).angular.resumeBootstrap(); | ||
expect(value).toBe(a1Injector); | ||
|
||
tick(100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this to flush remaining pending tasks (and stop fakeAsync()
from complaining)?
Would flush() also work (which is more explicit imo)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. Updated.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #22723
I wonder of the same should be done for the bootstrap call? That isn't quite the same since it isn't monkey-patching it, however
upgrade.bootstrap()
does replaceangular.bootstrap()
so consistent signatures would be nice. The dynamic version already has a return value, but maybe that inconsistency wouldn't matter since it is deprecated.