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

Upgrade documentation is conflicting as to which framework should be bootstrapped first #23225

Closed
nfriend opened this issue Apr 6, 2018 · 3 comments
Labels
help wanted An issue that is suitable for a community contributor (based on its complexity/scope).
Milestone

Comments

@nfriend
Copy link
Contributor

nfriend commented Apr 6, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Feature request
[x] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

In the documentation for the UpgradeModule (https://angular.io/api/upgrade/static/UpgradeModule), in the "Mental Model" section, the page states:

  1. AngularJS is always bootstrapped first and owns the root component.

However, in the "Example" section that follows, the code and comments seem to suggest the opposite:

// First we bootstrap the Angular HybridModule
// (We are using the dynamic browser platform as this example has not been compiled AoT)
platformBrowserDynamic().bootstrapModule(Ng2AppModule).then(ref => {
  // Once Angular bootstrap is complete then we bootstrap the AngularJS module
  const upgrade = ref.injector.get(UpgradeModule) as UpgradeModule;
  upgrade.bootstrap(document.body, [ng1AppModule.name]);
});

Note the comment: "Once Angular bootstrap is complete then we bootstrap the AngularJS module".

Further, the general "Upgrading from AngularJS" documentation page (https://angular.io/guide/upgrade) also seems to suggest that Angular should be bootstrapped first, followed by AngularJS:

Bootstrapping hybrid applications

To bootstrap a hybrid application, you must bootstrap each of the Angular and AngularJS parts of the application. You must bootstrap the Angular bits first and then ask the UpgradeModule to bootstrap the AngularJS bits next.

Expected behavior

The documentation should be consistent on which framework should be bootstrapped first.

Environment

Angular version: 5.2.9
@gkalpak
Copy link
Member

gkalpak commented Apr 7, 2018

Ooops! Good catch 👍
The wording is wrong. Angular is indeed bootstrapped first (but AngularJS does own the root of the hybrid app).

Would you be up to submitting a PR fixing the docs?

@gkalpak gkalpak added help wanted An issue that is suitable for a community contributor (based on its complexity/scope). comp: upgrade/static labels Apr 7, 2018
@ngbot ngbot bot added this to the needsTriage milestone Apr 7, 2018
@nfriend
Copy link
Contributor Author

nfriend commented Apr 9, 2018

Sure, I'll put together a PR.

nfriend added a commit to nfriend/angular that referenced this issue Apr 9, 2018
Clarify that Angular should be bootstrapped before AngularJS.

Closes angular#23225
nfriend added a commit to nfriend/angular that referenced this issue Apr 12, 2018
Clarify that Angular should be bootstrapped before AngularJS.

Closes angular#23225
nfriend added a commit to nfriend/angular that referenced this issue Apr 12, 2018
Clarify that Angular should be bootstrapped before AngularJS.

Closes angular#23225
IgorMinar pushed a commit that referenced this issue Apr 13, 2018
)

Clarify that Angular should be bootstrapped before AngularJS.

Closes #23225

PR Close #23270
wKoza pushed a commit to wKoza/angular that referenced this issue Apr 13, 2018
… (angular#23270)

Clarify that Angular should be bootstrapped before AngularJS.

Closes angular#23225

PR Close angular#23270
wKoza pushed a commit to wKoza/angular that referenced this issue Apr 13, 2018
… (angular#23270)

Clarify that Angular should be bootstrapped before AngularJS.

Closes angular#23225

PR Close angular#23270
wKoza pushed a commit to wKoza/angular that referenced this issue Apr 13, 2018
… (angular#23270)

Clarify that Angular should be bootstrapped before AngularJS.

Closes angular#23225

PR Close angular#23270
@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
help wanted An issue that is suitable for a community contributor (based on its complexity/scope).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants