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

docs: remove redundant whitespaces and fix minor typos #33422

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion aio/content/guide/aot-compiler.md
Expand Up @@ -144,7 +144,7 @@ describes the JSON format as a collection of TypeScript interfaces.
{@a expression-syntax}
### Expression syntax limitations

The AOT collector only understands a subset of JavaScript.
The AOT collector only understands a subset of JavaScript.
Define metadata objects with the following limited syntax:

<style>
Expand Down
4 changes: 2 additions & 2 deletions aio/content/guide/architecture-components.md
Expand Up @@ -35,7 +35,7 @@ Here's an example of basic metadata for `HeroListComponent`.

This example shows some of the most useful `@Component` configuration options:

* `selector`: A CSS selector that tells Angular to create and insert an instance of this component wherever it finds the corresponding tag in template HTML. For example, if an app's HTML contains `<app-hero-list></app-hero-list>`, then
* `selector`: A CSS selector that tells Angular to create and insert an instance of this component wherever it finds the corresponding tag in template HTML. For example, if an app's HTML contains `<app-hero-list></app-hero-list>`, then
Angular inserts an instance of the `HeroListComponent` view between those tags.

* `templateUrl`: The module-relative address of this component's HTML template. Alternatively, you can provide the HTML template inline, as the value of the `template` property. This template defines the component's *host view*.
Expand All @@ -54,7 +54,7 @@ Views are typically arranged hierarchically, allowing you to modify or show and
<figure class="lightbox">
<div class="card">
<img src="generated/images/guide/architecture/component-tree.png" alt="Component tree" class="left">
</div>
</div>
</figure>

A view hierarchy can include views from components in the same NgModule, but it also can (and often does) include views from components that are defined in different NgModules.
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/architecture-services.md
Expand Up @@ -84,7 +84,7 @@ or you can register providers with specific modules or components.
You register providers in the metadata of the service (in the `@Injectable()` decorator),
or in the `@NgModule()` or `@Component()` metadata

* By default, the Angular CLI command [`ng generate service`](cli/generate) registers a provider with the root injector for your service by including provider metadata in the `@Injectable()` decorator. The tutorial uses this method to register the provider of HeroService class definition.
* By default, the Angular CLI command [`ng generate service`](cli/generate) registers a provider with the root injector for your service by including provider metadata in the `@Injectable()` decorator. The tutorial uses this method to register the provider of HeroService class definition.

```
@Injectable({
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/build.md
Expand Up @@ -411,7 +411,7 @@ Proxy log levels are `info` (the default), `debug`, `warn`, `error`, and `silent

### Proxy multiple entries

You can proxy multiple entries to the same target by defining the configuration in JavaScript.
You can proxy multiple entries to the same target by defining the configuration in JavaScript.

Set the proxy configuration file to `proxy.conf.js` (instead of `proxy.conf.json`), and specify configuration files as in the following example.

Expand Down
8 changes: 4 additions & 4 deletions aio/content/guide/cli-builder.md
Expand Up @@ -30,7 +30,7 @@ This object contains a Boolean `success` field and an optional `error` field tha

Angular provides some builders that are used by the CLI for commands such as `ng build`, `ng test`, and `ng lint`.
Default target configurations for these and other built-in CLI builders can be found (and customized) in the "architect" section of the [workspace configuration file](guide/workspace-config), `angular.json`.
You can also extend and customize Angular by creating your own builders, which you can run using the [`ng run` CLI command](cli/run).
You can also extend and customize Angular by creating your own builders, which you can run using the [`ng run` CLI command](cli/run).

### Builder project structure

Expand Down Expand Up @@ -144,7 +144,7 @@ You can see an [example](https://github.com/angular/angular-cli/blob/ba21c855c0c

In our example, the shell command either finishes or is still executing, so there’s no need for a progress report, but we can report status so that a parent builder that called our builder would know what’s going on.
Use the `BuilderContext.reportStatus()` method to generate a status string of any length.
(Note that there’s no guarantee that a long string will be shown entirely; it could be cut to fit the UI that displays it.)
(Note that there’s no guarantee that a long string will be shown entirely; it could be cut to fit the UI that displays it.)
Pass an empty string to remove the status.

<code-example language="typescript" header="/command/index.ts">
Expand Down Expand Up @@ -253,7 +253,7 @@ In the `package.json` file, add a `builders` key that tells the Architect tool w
</code-example>

The official name of our builder is now ` @example/command-runner:command`.
The first part of this is the package name (resolved using node resolution), and the second part is the builder name (resolved using the `builders.json` file).
The first part of this is the package name (resolved using node resolution), and the second part is the builder name (resolved using the `builders.json` file).

Using one of our `options` is very straightforward, we did this in the previous section when we accessed `options.command`.

Expand Down Expand Up @@ -311,7 +311,7 @@ You might also add more alternative configurations to the `build` target, to def

#### Target strings

The generic `ng run` CLI command takes as its first argument a target string of the form *project:target[:configuration]*.
The generic `ng run` CLI command takes as its first argument a target string of the form *project:target[:configuration]*.

* *project*: The name of the Angular CLI project that the target is associated with.

Expand Down
13 changes: 5 additions & 8 deletions aio/content/guide/comparing-observables.md
Expand Up @@ -26,8 +26,8 @@ Observables are often compared to promises. Here are some key differences:
new Observable((observer) => { subscriber_fn });
// initiate execution
observable.subscribe(() => {
// observer handles notifications
});
// observer handles notifications
});
</code-example>

* Promises execute immediately, and just once. The computation of the result is initiated when the promise is created. There is no way to restart work. All `then` clauses (subscriptions) share the same computation.
Expand All @@ -37,8 +37,8 @@ observable.subscribe(() => {
new Promise((resolve, reject) => { executer_fn });
// handle return value
promise.then((value) => {
// handle result here
});
// handle result here
});
</code-example>

### Chaining
Expand Down Expand Up @@ -80,7 +80,7 @@ obs.subscribe(() => {

<code-example hideCopy>
promise.then(() => {
throw Error('my error');
throw Error('my error');
});
</code-example>

Expand Down Expand Up @@ -314,6 +314,3 @@ An observable produces values over time. An array is created as a static set of
</td>
</tr>
</table>



2 changes: 1 addition & 1 deletion aio/content/guide/complex-animation-sequences.md
Expand Up @@ -2,7 +2,7 @@

#### Prerequisites

A basic understanding of the following concepts:
A basic understanding of the following concepts:

* [Introduction to Angular animations](guide/animations)
* [Transition and triggers](guide/transition-and-triggers)
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/component-interaction.md
Expand Up @@ -129,7 +129,7 @@ Detect and act upon changes to input property values with the `ngOnChanges()` me

You may prefer this approach to the property setter when watching multiple, interacting input properties.

Learn about `ngOnChanges()` in the [LifeCycle Hooks](guide/lifecycle-hooks) chapter.
Learn about `ngOnChanges()` in the [Lifecycle Hooks](guide/lifecycle-hooks) chapter.

</div>

Expand Down
6 changes: 3 additions & 3 deletions aio/content/guide/creating-libraries.md
Expand Up @@ -47,7 +47,7 @@ You can build, test, and lint the project with CLI commands:
ng lint my-lib
</code-example>

Notice that the configured builder for the project is different from the default builder for app projects.
Notice that the configured builder for the project is different from the default builder for app projects.
This builder, among other things, ensures that the library is always built with the [AoT compiler](guide/aot-compiler), without the need to specify the `--prod` flag.

To make library code reusable you must define a public API for it. This "user layer" defines what is available to consumers of your library. A user of your library should be able to access public functionality (such as NgModules, service providers and general utility functions) through a single import path.
Expand Down Expand Up @@ -181,7 +181,7 @@ For instance, if you clone your git repository and run `npm install`, your edito
<div class="alert is-helpful">

When you import something from a library in an Angular app, Angular looks for a mapping between the library name and a location on disk.
When you install a library package, the mapping is in the `node_modules` folder. When you build your own library, it has to find the mapping in your `tsconfig` paths.
When you install a library package, the mapping is in the `node_modules` folder. When you build your own library, it has to find the mapping in your `tsconfig` paths.

Generating a library with the Angular CLI automatically adds its path to the `tsconfig` file.
The Angular CLI uses the `tsconfig` paths to tell the build system where to find the library.
Expand All @@ -204,7 +204,7 @@ ng build my-lib --watch

The CLI `build` command uses a different builder and invokes a different build tool for libraries than it does for applications.

* The build system for apps, `@angular-devkit/build-angular`, is based on `webpack`, and is included in all new Angular CLI projects.
* The build system for apps, `@angular-devkit/build-angular`, is based on `webpack`, and is included in all new Angular CLI projects.
* The build system for libraries is based on `ng-packagr`. It is only added to your dependencies when you add a library using `ng generate library my-lib`.

The two build systems support different things, and even where they support the same things, they do those things differently.
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/dependency-injection-in-action.md
Expand Up @@ -586,7 +586,7 @@ an interface is not a valid DI token because it is a TypeScript artifact that do
Use this abstract class interface to get the strong typing of an interface,
and also use it as a provider token in the way you would a normal class.

A class interface should define *only* the members that its consumers are allowed to call.
A class interface should define *only* the members that its consumers are allowed to call.
Such a narrowing interface helps decouple the concrete class from its consumers.


Expand Down
3 changes: 1 addition & 2 deletions aio/content/guide/dependency-injection-navtree.md
Expand Up @@ -233,7 +233,7 @@ A component that could serve as a parent *should* implement the class interface



Doing so adds clarity to the code. But it's not technically necessary.
Doing so adds clarity to the code. But it's not technically necessary.
Although `AlexComponent` has a `name` property, as required by its `Base` class,
its class signature doesn't mention `Parent`.

Expand Down Expand Up @@ -283,4 +283,3 @@ Here's a revised version that defaults to `parent` but also accepts an optional
And here's how you could use it with a different parent type.

<code-example path="dependency-injection-in-action/src/app/parent-finder.component.ts" region="beth-providers" header="dependency-injection-in-action/src/app/parent-finder.component.ts"></code-example>

8 changes: 3 additions & 5 deletions aio/content/guide/dependency-injection.md
Expand Up @@ -114,7 +114,7 @@ from the injector of its parent NgModule, or from the `root` injector.

* Learn more about the [different kinds of providers](guide/dependency-injection-providers).

* Learn more about how the [injector hierarchy](guide/hierarchical-dependency-injection) works.
* Learn more about how the [injector hierarchy](guide/hierarchical-dependency-injection) works.

</div>

Expand Down Expand Up @@ -229,7 +229,7 @@ Here is the revised `HeroService` that injects `Logger`, side by side with the p

The constructor asks for an injected instance of `Logger` and stores it in a private field called `logger`. The `getHeroes()` method logs a message when asked to fetch heroes.

Notice that the `Logger` service also has the `@Injectable()` decorator, even though it might not need its own dependencies. In fact, the `@Injectable()` decorator is **required for all services**.
Notice that the `Logger` service also has the `@Injectable()` decorator, even though it might not need its own dependencies. In fact, the `@Injectable()` decorator is **required for all services**.

When Angular creates a class whose constructor has parameters, it looks for type and injection metadata about those parameters so that it can inject the correct service.
If Angular can't find that parameter information, it throws an error.
Expand Down Expand Up @@ -293,7 +293,7 @@ value of `logger` to null.

<div class="alert is-helpful">

`@Inject()` and `@Optional()` are _parameter decorators_. They alter the way the DI framework provides a dependency, by annotating the dependency parameter on the constructor of the class that requires the dependency.
`@Inject()` and `@Optional()` are _parameter decorators_. They alter the way the DI framework provides a dependency, by annotating the dependency parameter on the constructor of the class that requires the dependency.

Learn more about parameter decorators in [Hierarchical Dependency Injectors](guide/hierarchical-dependency-injection).

Expand All @@ -314,5 +314,3 @@ Dive deeper into the capabilities and advanced feature of the Angular DI system
* Learn more about [DI tokens and providers](guide/dependency-injection-providers).

* [Dependency Injection in Action](guide/dependency-injection-in-action) is a cookbook for some of the interesting things you can do with DI.


4 changes: 2 additions & 2 deletions aio/content/guide/deployment.md
Expand Up @@ -206,7 +206,7 @@ modified to serve `index.html`:

``` go
package main

import (
"net/http"
"os"
Expand Down Expand Up @@ -457,7 +457,7 @@ Even as JavaScript continues to evolve, with new features being introduced, not

The code you write in development using TypeScript is compiled and bundled into ES2015, the JavaScript syntax that is compatible with most browsers.
All modern browsers support ES2015 and beyond, but in most cases, you still have to account for users accessing your application from a browser that doesn't.
When targeting older browsers, [polyfills](guide/browser-support#polyfills) can bridge the gap by providing functionality that doesn't exist in the older versions of JavaScript supported by those browsers.
When targeting older browsers, [polyfills](guide/browser-support#polyfills) can bridge the gap by providing functionality that doesn't exist in the older versions of JavaScript supported by those browsers.

To maximize compatibility, you could ship a single bundle that includes all your compiled code, plus any polyfills that may be needed.
Users with modern browsers, however, shouldn't have to pay the price of increased bundle size that comes with polyfills they don't need.
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/docs-style-guide.md
Expand Up @@ -37,7 +37,7 @@ Angular docs are written in Markdown, with custom extensions for this site. Corr

* **Angular coding style:** Coding style for example apps and code snippets.
Code examples are encouraged for demonstrating how to apply the concepts and features discussed.
Angular has a custom framework that enables authors to include code snippets directly from example apps that are automatically tested as part of doc builds.
Angular has a custom framework that enables authors to include code snippets directly from example apps that are automatically tested as part of doc builds.
To contribute example code, you must understand Angular itself and the custom framework for Angular doc examples.

For each aspect of style, the following table explains where to find the primary guidelines and what this Angular Documentation Style Guide offers.
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/dynamic-form.md
Expand Up @@ -142,7 +142,7 @@ Notice this component can present any type of question in your model.
You only have two types of questions at this point but you can imagine many more.
The `ngSwitch` determines which type of question to display.

In both components you're relying on Angular's **formGroup** to connect the template HTML to the
In both components you're relying on Angular's **formGroup** to connect the template HTML to the
underlying control objects, populated from the question model with display and validation rules.

`formControlName` and `formGroup` are directives defined in
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/elements.md
Expand Up @@ -40,7 +40,7 @@ After you register your configured class with the browser's custom-element regis
<my-popup message="Use Angular!"></my-popup>
```

When your custom element is placed on a page, the browser creates an instance of the registered class and adds it to the DOM. The content is provided by the component's template, which uses Angular template syntax, and is rendered using the component and DOM data. Input properties in the component correspond to input attributes for the element.
When your custom element is placed on a page, the browser creates an instance of the registered class and adds it to the DOM. The content is provided by the component's template, which uses Angular template syntax, and is rendered using the component and DOM data. Input properties in the component correspond to input attributes for the element.

<figure class="lightbox">
<div class="card">
Expand Down
2 changes: 1 addition & 1 deletion aio/content/guide/entry-components.md
Expand Up @@ -4,7 +4,7 @@ An entry component is any component that Angular loads imperatively, (which mean

<div class="alert is-helpful">

To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components.
To contrast the two types of components, there are components which are included in the template, which are declarative. Additionally, there are components which you load imperatively; that is, entry components.

</div>

Expand Down