Skip to content

docs: NgModule guide prose for CLI (partial) #19776

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

Closed
wants to merge 1 commit into from

Conversation

wardbell
Copy link
Contributor

@wardbell wardbell commented Oct 18, 2017

See Issue #19510

BEGINS necessary changes for NgModules guide ... before I realized that the changes that @kapunahelewong is making have not yet been merged! Handing this off to her.

Update 10/20

@kapunahelewong says we should finish this PR because her substantial changes to NgModules guide will not be ready soon enough. She will incorporate the changes in this PR into her work at her future convenience.

Update 10/23

I think it's "done". At least it's done enough to count as converted for CLI.

Update 10/25

Also replaces “Angular Module” with “NgModule” wherever that is clarifying.
Continue using “module” when qualified as in “feature module”, “root module”, “routing module”, etc.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

@wardbell wardbell self-assigned this Oct 18, 2017
@wardbell wardbell force-pushed the cli-ngmodule branch 2 times, most recently from 201191b to 4acc5f3 Compare October 18, 2017 07:59
@wardbell wardbell changed the title docs: Bootstrapping and NgModule prose for CLI docs: NgModule prose for CLI (partial) Oct 18, 2017
@wardbell wardbell changed the title docs: NgModule prose for CLI (partial) docs: NgModule guide prose for CLI (partial) Oct 18, 2017
@mary-poppins
Copy link

You can preview 40290ab at https://pr19776-40290ab.ngbuilds.io/.

@mary-poppins
Copy link

You can preview c24bb83 at https://pr19776-c24bb83.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 596e941 at https://pr19776-596e941.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 92d857c at https://pr19776-92d857c.ngbuilds.io/.

@mary-poppins
Copy link

You can preview a1f1299 at https://pr19776-a1f1299.ngbuilds.io/.

@skatterwe
Copy link

skatterwe commented Oct 23, 2017 via email

@wardbell wardbell force-pushed the cli-ngmodule branch 2 times, most recently from c9d8ecc to cb8631e Compare October 23, 2017 10:10
@mary-poppins
Copy link

You can preview cb8631e at https://pr19776-cb8631e.ngbuilds.io/.

@mary-poppins
Copy link

You can preview ed10b8f at https://pr19776-ed10b8f.ngbuilds.io/.

@skatterwe
Copy link

skatterwe commented Oct 23, 2017 via email

@mary-poppins
Copy link

You can preview 6e59283 at https://pr19776-6e59283.ngbuilds.io/.

@wardbell wardbell force-pushed the cli-ngmodule branch 2 times, most recently from cc3c492 to 7381a36 Compare November 16, 2017 07:02
@mary-poppins
Copy link

You can preview 7381a36 at https://pr19776-7381a36.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 9a9f9ab at https://pr19776-9a9f9ab.ngbuilds.io/.

@wardbell wardbell requested a review from gkalpak November 16, 2017 08:24
@wardbell
Copy link
Contributor Author

wardbell commented Nov 16, 2017

@gkalpak Not sure why but apparently this PR needs your OK. It's part of the samples->CLI project.

@wardbell wardbell added the target: major This PR is targeted for the next major release label Nov 16, 2017
Copy link
Contributor

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Nice piece of work @wardbell. I have approved it with a handful (~40!) minor comments, from which you can pick and choose before labelling for merge.

@@ -1,14 +1,19 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

export const routes: Routes = [
import { ContactModule } from './contact/contact.module.3';
Copy link
Contributor

Choose a reason for hiding this comment

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

unusual whitespace?


import { FormsModule } from '@angular/forms';
import { ContactService } from './contact/contact.service';
import { ContactHighlightDirective } from './contact/contact-highlight.directive';
Copy link
Contributor

Choose a reason for hiding this comment

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

is it a conscious decision to align the froms unless the import is too wide?

Copy link
Contributor Author

@wardbell wardbell Nov 17, 2017

Choose a reason for hiding this comment

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

I was aligning imports for readability for a long time. But it's difficult to maintain and I'm abandoning that effort as I go. In this PR, due to time/money constraints, I'll limit adjustments to the worst cases that you've identified.

@@ -1,4 +1,4 @@
/* tslint:disable */
// #docplaster
Copy link
Contributor

Choose a reason for hiding this comment

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

not related to this PR but we should get agreement from "someone" to change the default doc-plaster to the empty string :-)

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 lost that battle so long ago ... as in on DAY ONE. You're welcome to take it up again.

[(ngModel)]="contact.name"
name="name" #name="ngModel" >
[(ngModel)]="contact.name"
name="name" #name="ngModel" >
Copy link
Contributor

Choose a reason for hiding this comment

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

should these attributes be indented or is this a conscious coding style in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indented. Something messed it up. Fixing.

export class ContactService implements OnDestroy {
// #enddocregion
constructor() { console.log('ContactService instance created.'); }
ngOnDestroy() { console.log('ContactService instance destroyed.'); }
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these just here for your debugging or important parts of the example?

Copy link
Contributor

Choose a reason for hiding this comment

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


<div class="l-sub-section">



A lazy-loaded module location is a _string_, not a _type_.
Copy link
Contributor

Choose a reason for hiding this comment

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

The references to "module" in this paragraph need changing to NgModule.

</code-example>

Re-exporting `RouterModule` makes the router directives
Copy link
Contributor

Choose a reason for hiding this comment

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

superfluous space

highlight.directive.ts
</div>
Do not import the `HeroModule` or `CrisisModule` or any of their classes outside of their respective file folders.
If you do, you will unintentionally load those modules and all of their code,
Copy link
Contributor

Choose a reason for hiding this comment

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

unintentionally "eager" load?

<div class="alert is-critical">



Do *not* specify app-wide singleton `providers` in a shared module.
A lazy-loaded module that imports that shared module makes its own copy of the service.
Copy link
Contributor

Choose a reason for hiding this comment

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

lazy-loaded NgModule

The `@NgModule` metadata should be familiar.
You declare the `TitleComponent` because this module owns it and you export it
because `AppComponent` (which is in `AppModule`) displays the title in its template.
You declare the `TitleComponent` because this module owns it.
Copy link
Contributor

Choose a reason for hiding this comment

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

module -> NgModule

@petebacondarwin petebacondarwin added the action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews label Nov 17, 2017
Also replaces “Angular Module” with “NgModule” wherever that is clarifying.
Continue using “module” when qualified as in “feature module”, “root module”, “routing module”, etc.
@wardbell
Copy link
Contributor Author

@petebacondarwin Adopted almost all of your most-welcome suggestions. Will add the merge label as soon as it clears CI. Thanks again!

@mary-poppins
Copy link

You can preview 02f40d3 at https://pr19776-02f40d3.ngbuilds.io/.

@wardbell
Copy link
Contributor Author

The CI fail is a flake - a SauceLabs timeout - that has nothing to do with this PR.

@wardbell wardbell 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 Nov 20, 2017
@mhevery mhevery closed this in 816d5ba Nov 21, 2017
@mhevery
Copy link
Contributor

mhevery commented Nov 22, 2017

@wardbell all docs changes should go to both master and patch, please label accordingly next time.

@mhevery mhevery added target: patch This PR is targeted for the next patch release and removed target: major This PR is targeted for the next major release labels Nov 22, 2017
mhevery pushed a commit that referenced this pull request Nov 22, 2017
Also replaces “Angular Module” with “NgModule” wherever that is clarifying.
Continue using “module” when qualified as in “feature module”, “root module”, “routing module”, etc.

PR Close #19776
@petebacondarwin
Copy link
Contributor

@wardbell all docs changes should go to both master and patch, please label accordingly next time.

@mhevery - that may not be the case! If the docs change refers to something that is only on master then it would not make sense to land it on patch. I accept that in this case @wardbell may have forgotten that patch now refers to 5.x (whereas recently it referred to 4.x) so it is very likely that this is supposed to land on both.

@Foxandxss Foxandxss deleted the cli-ngmodule branch November 22, 2017 17:07
@wardbell
Copy link
Contributor Author

@petebacondarwin @mhevery Yes, I thought patch was still 4.x.

@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 12, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants