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

fix(upgrade): propagate return value of resumeBootstrap #22754

Closed
wants to merge 1 commit into from

Conversation

jbedard
Copy link
Contributor

@jbedard jbedard commented Mar 14, 2018

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 replace angular.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.


const value = (<any>window).angular.resumeBootstrap();
expect(value).toBeDefined();
expect(value.invoke).toBeDefined();
Copy link
Member

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();
Copy link
Member

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.)

@gkalpak gkalpak added type: bug/fix action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews comp: upgrade/dynamic target: patch This PR is targeted for the next patch release labels Mar 14, 2018
@gkalpak
Copy link
Member

gkalpak commented Mar 14, 2018

Also, linting fails 😱 (Running gulp format should fix it.)

@jbedard jbedard force-pushed the 22723 branch 3 times, most recently from f945f75 to 6b7bf7e Compare March 16, 2018 06:22
@jbedard
Copy link
Contributor Author

jbedard commented Mar 17, 2018

I think this is ready...

const value = (<any>window).angular.resumeBootstrap();
expect(value).toBe(a1Injector);

tick(100);
Copy link
Member

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)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Updated.

@gkalpak gkalpak added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Mar 20, 2018
@IgorMinar
Copy link
Contributor

alxhub pushed a commit that referenced this pull request Apr 2, 2018
@alxhub alxhub closed this in a2330ff Apr 2, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release type: bug/fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

upgrade patch of resumeBootstrap removes the return value
4 participants