docs: remove prerequisite section in NgModules docs (#31169)

PR Close #31169
This commit is contained in:
Kapunahele Wong 2019-06-20 14:05:25 -04:00 committed by Matias Niemelä
parent 12fd06916b
commit fc61284dbe
11 changed files with 10 additions and 95 deletions

View File

@ -1,12 +1,5 @@
# Entry Components # Entry Components
#### Prerequisites:
A basic understanding of the following concepts:
* [Bootstrapping](guide/bootstrapping).
<hr />
An entry component is any component that Angular loads imperatively, (which means youre not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition. An entry component is any component that Angular loads imperatively, (which means youre not referencing it in the template), by type. You specify an entry component by bootstrapping it in an NgModule, or including it in a routing definition.
<div class="alert is-helpful"> <div class="alert is-helpful">

View File

@ -1,12 +1,6 @@
# Feature Modules # Feature Modules
Feature modules are NgModules for the purpose of organizing code. Feature modules are NgModules for the purpose of organizing code.
#### Prerequisites
A basic understanding of the following:
* [Bootstrapping](guide/bootstrapping).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
For the final sample app with a feature module that this page describes, For the final sample app with a feature module that this page describes,
see the <live-example></live-example>. see the <live-example></live-example>.

View File

@ -1,12 +1,5 @@
# Frequently Used Modules # Frequently Used Modules
#### Prerequisites
A basic understanding of [Bootstrapping](guide/bootstrapping).
<hr>
An Angular app needs at least one module that serves as the root module. An Angular app needs at least one module that serves as the root module.
As you add features to your app, you can add them in modules. As you add features to your app, you can add them in modules.
The following are frequently used Angular modules with examples The following are frequently used Angular modules with examples

View File

@ -1,23 +1,13 @@
# Lazy Loading Feature Modules # Lazy Loading Feature Modules
#### Prerequisites
A basic understanding of the following:
* [Feature Modules](guide/feature-modules).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
* [Types of Feature Modules](guide/module-types).
* [Routing and Navigation](guide/router).
For the final sample app with two lazy loaded modules that this page describes, see the
<live-example></live-example>.
<hr>
## High level view ## High level view
By default, NgModules are eagerly loaded, which means that as soon as the app loads, so do all the NgModules, whether or not they are immediately necessary. For large apps with lots of routes, consider lazy loading&mdash;a design pattern that loads NgModules as needed. Lazy loading helps keep initial By default, NgModules are eagerly loaded, which means that as soon as the app loads, so do all the NgModules, whether or not they are immediately necessary. For large apps with lots of routes, consider lazy loading&mdash;a design pattern that loads NgModules as needed. Lazy loading helps keep initial
bundle sizes smaller, which in turn helps decrease load times. bundle sizes smaller, which in turn helps decrease load times.
For the final sample app with two lazy loaded modules that this page describes, see the
<live-example></live-example>.
There are three main steps to setting up a lazy loaded feature module: There are three main steps to setting up a lazy loaded feature module:
1. Create the feature module. 1. Create the feature module.

View File

@ -1,16 +1,5 @@
# Types of Feature Modules # Types of Feature Modules
#### Prerequisites
A basic understanding of the following concepts:
* [Feature Modules](guide/feature-modules).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
<hr>
There are five general categories of feature modules which There are five general categories of feature modules which
tend to fall into the following groups: tend to fall into the following groups:

View File

@ -1,15 +1,5 @@
# NgModule API # NgModule API
#### Prerequisites
A basic understanding of the following concepts:
* [Bootstrapping](guide/bootstrapping).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
<hr />
## Purpose of `@NgModule`
At a high level, NgModules are a way to organize Angular apps At a high level, NgModules are a way to organize Angular apps
and they accomplish this through the metadata in the `@NgModule` and they accomplish this through the metadata in the `@NgModule`
decorator. decorator.

View File

@ -1,13 +1,5 @@
# NgModule FAQs # NgModule FAQs
#### Prerequisites:
A basic understanding of the following concepts:
* [NgModules](guide/ngmodules).
<hr />
NgModules help organize an application into cohesive blocks of functionality. NgModules help organize an application into cohesive blocks of functionality.
This page answers the questions many developers ask about NgModule design and implementation. This page answers the questions many developers ask about NgModule design and implementation.

View File

@ -1,13 +1,9 @@
# JavaScript Modules vs. NgModules # JavaScript Modules vs. NgModules
#### Prerequisites
A basic understanding of [JavaScript/ECMAScript modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/).
<hr>
JavaScript and Angular use modules to organize code, and JavaScript and Angular use modules to organize code, and
though they organize it differently, Angular apps rely on both. though they organize it differently, Angular apps rely on both.
## JavaScript modules ## JavaScript modules
In JavaScript, modules are individual files with JavaScript code in them. To make whats in them available, you write an export statement, usually after the relevant code, like this: In JavaScript, modules are individual files with JavaScript code in them. To make whats in them available, you write an export statement, usually after the relevant code, like this:
@ -24,6 +20,8 @@ import { AppComponent } from './app.component';
JavaScript modules help you namespace, preventing accidental global variables. JavaScript modules help you namespace, preventing accidental global variables.
For more information on JavaScript modules, see [JavaScript/ECMAScript modules](https://hacks.mozilla.org/2015/08/es6-in-depth-modules/).
## NgModules ## NgModules
<!-- KW-- perMisko: let's discuss. This does not answer the question why it is different. Also, last sentence is confusing.--> <!-- KW-- perMisko: let's discuss. This does not answer the question why it is different. Also, last sentence is confusing.-->

View File

@ -1,16 +1,10 @@
# Providers # Providers
#### Prerequisites: A provider is an instruction to the DI system on how to obtain a value for a dependency. Most of the time, these dependencies are services that you create and provide.
* A basic understanding of [Bootstrapping](guide/bootstrapping).
* Familiarity with [Frequently Used Modules](guide/frequent-ngmodules).
For the final sample app using the provider that this page describes, For the final sample app using the provider that this page describes,
see the <live-example></live-example>. see the <live-example></live-example>.
<hr>
A provider is an instruction to the DI system on how to obtain a value for a dependency. Most of the time, these dependencies are services that you create and provide.
## Providing a service ## Providing a service
If you already have an app that was created with the [Angular CLI](cli), you can create a service using the [`ng generate`](cli/generate) CLI command in the root project directory. Replace _User_ with the name of your service. If you already have an app that was created with the [Angular CLI](cli), you can create a service using the [`ng generate`](cli/generate) CLI command in the root project directory. Replace _User_ with the name of your service.

View File

@ -1,18 +1,5 @@
# Sharing Modules # Sharing Modules
#### Prerequisites
A basic understanding of the following:
* [Feature Modules](guide/feature-modules).
* [JavaScript Modules vs. NgModules](guide/ngmodule-vs-jsmodule).
* [Frequently Used Modules](guide/frequent-ngmodules).
* [Routing and Navigation](guide/router).
* [Lazy loading modules](guide/lazy-loading-ngmodules).
<!--* Components (#TBD) We dont have a page just on the concept of components, but I think one would be helpful for beginners.-->
<hr>
Creating shared modules allows you to organize and streamline your code. You can put commonly Creating shared modules allows you to organize and streamline your code. You can put commonly
used directives, pipes, and components into one module and then import just that module wherever used directives, pipes, and components into one module and then import just that module wherever
you need it in other parts of your app. you need it in other parts of your app.
@ -54,7 +41,7 @@ to import `FormsModule`, `SharedModule` can still export
way, you can give other modules access to `FormsModule` without way, you can give other modules access to `FormsModule` without
having to import it directly into the `@NgModule` decorator. having to import it directly into the `@NgModule` decorator.
### Using components vs services from other modules. ### Using components vs services from other modules
There is an important distinction between using another module's component and There is an important distinction between using another module's component and
using a service from another module. Import modules when you want to use using a service from another module. Import modules when you want to use

View File

@ -1,15 +1,10 @@
# Singleton services # Singleton services
#### Prerequisites: A singleton service is a service for which only once instance exists in an app.
* A basic understanding of [Bootstrapping](guide/bootstrapping).
* Familiarity with [Providers](guide/providers).
For a sample app using the app-wide singleton service that this page describes, see the For a sample app using the app-wide singleton service that this page describes, see the
<live-example name="ngmodules"></live-example> showcasing all the documented features of NgModules. <live-example name="ngmodules"></live-example> showcasing all the documented features of NgModules.
<hr />
## Providing a singleton service ## Providing a singleton service
There are two ways to make a service a singleton in Angular: There are two ways to make a service a singleton in Angular: