Skip to content

Commit e42a057

Browse files
kwalrathmprobst
authored andcommitted
docs(cheatsheet): complete the copy edit (angular#11215)
…and general cleanup of the cheatsheet.
1 parent 0bb94df commit e42a057

File tree

11 files changed

+96
-146
lines changed

11 files changed

+96
-146
lines changed

modules/@angular/docs/cheatsheet/built-in-directives.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Built-in directives
99
syntax:
1010
`<section *ngIf="showSection">`|`*ngIf`
1111
description:
12-
Removes or recreates a portion of the DOM tree based on the showSection expression.
12+
Removes or recreates a portion of the DOM tree based on the `showSection` expression.
1313

1414
@cheatsheetItem
1515
syntax:
@@ -25,7 +25,7 @@ syntax:
2525
<template ngSwitchDefault>...</template>
2626
</div>`|`[ngSwitch]`|`[ngSwitchCase]`|`ngSwitchCase`|`ngSwitchDefault`
2727
description:
28-
Conditionally swaps the contents of the div by selecting one of the embedded templates based on the current value of conditionExpression.
28+
Conditionally swaps the contents of the div by selecting one of the embedded templates based on the current value of `conditionExpression`.
2929

3030
@cheatsheetItem
3131
syntax:

modules/@angular/docs/cheatsheet/class-decorators.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,13 @@ syntax(ts):
3737
`@Injectable()
3838
class MyService() {}`|`@Injectable()`
3939
syntax(js):
40-
`var OtherService = ng.core.Class({constructor: function() { }});
41-
var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});`|`var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});`
40+
`var OtherService = ng.core.Class(
41+
{constructor: function() { }});
42+
var MyService = ng.core.Class(
43+
{constructor: [OtherService, function(otherService) { }]});`|`var MyService = ng.core.Class({constructor: [OtherService, function(otherService) { }]});`
4244
description:
4345
{@target ts}Declares that a class has dependencies that should be injected into the constructor when the dependency injector is creating an instance of this class.
4446
{@endtarget}
4547
{@target js}
46-
Declares a service to inject into a class by providing an array with the services with the final item being the function which will receive the injected services.
48+
Declares a service to inject into a class by providing an array with the services, with the final item being the function to receive the injected services.
4749
{@endtarget}

modules/@angular/docs/cheatsheet/component-configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ syntax(ts):
1919
syntax(js):
2020
`viewProviders: [MyService, { provide: ... }]`|`viewProviders:`
2121
description:
22-
Array of dependency injection providers scoped to this component's view.
22+
List of dependency injection providers scoped to this component's view.
2323

2424

2525
@cheatsheetItem

modules/@angular/docs/cheatsheet/dependency-injection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ syntax(ts):
99
syntax(js):
1010
`{ provide: MyService, useClass: MyMockService }`|`provide`|`useClass`
1111
description:
12-
Sets or overrides the provider for MyService to the MyMockService class.
12+
Sets or overrides the provider for `MyService` to the `MyMockService` class.
1313

1414

1515
@cheatsheetItem
@@ -18,7 +18,7 @@ syntax(ts):
1818
syntax(js):
1919
`{ provide: MyService, useFactory: myFactory }`|`provide`|`useFactory`
2020
description:
21-
Sets or overrides the provider for MyService to the myFactory factory function.
21+
Sets or overrides the provider for `MyService` to the `myFactory` factory function.
2222

2323

2424
@cheatsheetItem
@@ -27,4 +27,4 @@ syntax(ts):
2727
syntax(js):
2828
`{ provide: MyValue, useValue: 41 }`|`provide`|`useValue`
2929
description:
30-
Sets or overrides the provider for MyValue to the value 41.
30+
Sets or overrides the provider for `MyValue` to the value `41`.

modules/@angular/docs/cheatsheet/directive-and-component-decorators.md

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,77 +4,83 @@ Class field decorators for directives and components
44
@description
55
{@target ts}`import { Input, ... } from '@angular/core';`{@endtarget}
66
{@target js}Available from the `ng.core` namespace{@endtarget}
7-
{@target dart}`import 'package:angular2/core.dart';`{@endtarget}
87

98
@cheatsheetItem
10-
syntax(ts dart):
9+
syntax(ts):
1110
`@Input() myProperty;`|`@Input()`
1211
syntax(js):
1312
`ng.core.Input(myProperty, myComponent);`|`ng.core.Input(`|`);`
1413
description:
15-
Declares an input property that we can update via property binding (e.g.
14+
Declares an input property that you can update via property binding (example:
1615
`<my-cmp [myProperty]="someExpression">`).
1716

1817

1918
@cheatsheetItem
20-
syntax(ts dart):
19+
syntax(ts):
2120
`@Output() myEvent = new EventEmitter();`|`@Output()`
2221
syntax(js):
23-
`myEvent = new ng.core.EventEmitter(); ng.core.Output(myEvent, myComponent);`|`ng.core.Output(`|`);`
22+
`myEvent = new ng.core.EventEmitter();
23+
ng.core.Output(myEvent, myComponent);`|`ng.core.Output(`|`);`
2424
description:
25-
Declares an output property that fires events to which we can subscribe with an event binding (e.g. `<my-cmp (myEvent)="doSomething()">`).
25+
Declares an output property that fires events that you can subscribe to with an event binding (example: `<my-cmp (myEvent)="doSomething()">`).
2626

2727

2828
@cheatsheetItem
29-
syntax(ts dart):
29+
syntax(ts):
3030
`@HostBinding('[class.valid]') isValid;`|`@HostBinding('[class.valid]')`
3131
syntax(js):
32-
`ng.core.HostBinding('[class.valid]', 'isValid', myComponent);`|`ng.core.HostBinding('[class.valid]', 'isValid'`|`);`
32+
`ng.core.HostBinding('[class.valid]',
33+
'isValid', myComponent);`|`ng.core.HostBinding('[class.valid]', 'isValid'`|`);`
3334
description:
34-
Binds a host element property (e.g. CSS class valid) to directive/component property (e.g. isValid).
35+
Binds a host element property (here, the CSS class `valid`) to a directive/component property (`isValid`).
3536

3637

3738

3839
@cheatsheetItem
39-
syntax(ts dart):
40+
syntax(ts):
4041
`@HostListener('click', ['$event']) onClick(e) {...}`|`@HostListener('click', ['$event'])`
4142
syntax(js):
42-
`ng.core.HostListener('click', ['$event'], onClick(e) {...}, myComponent);`|`ng.core.HostListener('click', ['$event'], onClick(e)`|`);`
43+
`ng.core.HostListener('click',
44+
['$event'], onClick(e) {...}, myComponent);`|`ng.core.HostListener('click', ['$event'], onClick(e)`|`);`
4345
description:
44-
Subscribes to a host element event (e.g. click) with a directive/component method (e.g. onClick), optionally passing an argument ($event).
46+
Subscribes to a host element event (`click`) with a directive/component method (`onClick`), optionally passing an argument (`$event`).
4547

4648

4749
@cheatsheetItem
48-
syntax(ts dart):
50+
syntax(ts):
4951
`@ContentChild(myPredicate) myChildComponent;`|`@ContentChild(myPredicate)`
5052
syntax(js):
51-
`ng.core.ContentChild(myPredicate, 'myChildComponent', myComponent);`|`ng.core.ContentChild(myPredicate,`|`);`
53+
`ng.core.ContentChild(myPredicate,
54+
'myChildComponent', myComponent);`|`ng.core.ContentChild(myPredicate,`|`);`
5255
description:
53-
Binds the first result of the component content query (myPredicate) to the myChildComponent property of the class.
56+
Binds the first result of the component content query (`myPredicate`) to a property (`myChildComponent`) of the class.
5457

5558

5659
@cheatsheetItem
57-
syntax(ts dart):
60+
syntax(ts):
5861
`@ContentChildren(myPredicate) myChildComponents;`|`@ContentChildren(myPredicate)`
5962
syntax(js):
60-
`ng.core.ContentChildren(myPredicate, 'myChildComponents', myComponent);`|`ng.core.ContentChildren(myPredicate,`|`);`
63+
`ng.core.ContentChildren(myPredicate,
64+
'myChildComponents', myComponent);`|`ng.core.ContentChildren(myPredicate,`|`);`
6165
description:
62-
Binds the results of the component content query (myPredicate) to the myChildComponents property of the class.
66+
Binds the results of the component content query (`myPredicate`) to a property (`myChildComponents`) of the class.
6367

6468

6569
@cheatsheetItem
66-
syntax(ts dart):
70+
syntax(ts):
6771
`@ViewChild(myPredicate) myChildComponent;`|`@ViewChild(myPredicate)`
6872
syntax(js):
69-
`ng.core.ViewChild(myPredicate, 'myChildComponent', myComponent);`|`ng.core.ViewChild(myPredicate,`|`);`
73+
`ng.core.ViewChild(myPredicate,
74+
'myChildComponent', myComponent);`|`ng.core.ViewChild(myPredicate,`|`);`
7075
description:
71-
Binds the first result of the component view query (myPredicate) to the myChildComponent property of the class. Not available for directives.
76+
Binds the first result of the component view query (`myPredicate`) to a property (`myChildComponent`) of the class. Not available for directives.
7277

7378

7479
@cheatsheetItem
75-
syntax(ts dart):
80+
syntax(ts):
7681
`@ViewChildren(myPredicate) myChildComponents;`|`@ViewChildren(myPredicate)`
7782
syntax(js):
78-
`ng.core.ViewChildren(myPredicate, 'myChildComponents', myComponent);`|`ng.core.ViewChildren(myPredicate,`|`);`
83+
`ng.core.ViewChildren(myPredicate,
84+
'myChildComponents', myComponent);`|`ng.core.ViewChildren(myPredicate,`|`);`
7985
description:
80-
Binds the results of the component view query (myPredicate) to the myChildComponents property of the class. Not available for directives.
86+
Binds the results of the component view query (`myPredicate`) to a property (`myChildComponents`) of the class. Not available for directives.

modules/@angular/docs/cheatsheet/directive-configuration.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ Directive configuration
44
@description
55
{@target ts}`@Directive({ property1: value1, ... })`{@endtarget}
66
{@target js}`ng.core.Directive({ property1: value1, ... }).Class({...})`{@endtarget}
7-
{@target dart}`@Directive(property1: value1, ...)`{@endtarget}
87

98
@cheatsheetItem
109
syntax:
@@ -16,9 +15,9 @@ Specifies a CSS selector that identifies this directive within a template. Suppo
1615
Does not support parent-child relationship selectors.
1716

1817
@cheatsheetItem
19-
syntax(ts dart):
18+
syntax(ts):
2019
`providers: [MyService, { provide: ... }]`|`providers:`
2120
syntax(js):
2221
`providers: [MyService, { provide: ... }]`|`providers:`
2322
description:
24-
Array of dependency injection providers for this directive and its children.
23+
List of dependency injection providers for this directive and its children.

modules/@angular/docs/cheatsheet/forms.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ Forms
44
@description
55
{@target ts}`import { FormsModule } from '@angular/forms';`{@endtarget}
66
{@target js}Available using the `ng.forms.FormsModule` module{@endtarget}
7-
{@target dart}Available using `platform_directives` in pubspec{@endtarget}
87

98
@cheatsheetItem
109
syntax:
1110
`<input [(ngModel)]="userName">`|`[(ngModel)]`
1211
description:
13-
Provides two-way data-binding, parsing and validation for form controls.
12+
Provides two-way data-binding, parsing, and validation for form controls.

modules/@angular/docs/cheatsheet/lifecycle hooks.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,20 @@
22
Directive and component change detection and lifecycle hooks
33
@cheatsheetIndex 9
44
@description
5-
{@target ts dart}(implemented as class methods){@endtarget}
5+
{@target ts}(implemented as class methods){@endtarget}
66
{@target js}(implemented as component properties){@endtarget}
77

88
@cheatsheetItem
99
syntax(ts):
1010
`constructor(myService: MyService, ...) { ... }`|`constructor(myService: MyService, ...)`
1111
syntax(js):
1212
`constructor: function(MyService, ...) { ... }`|`constructor: function(MyService, ...)`
13-
syntax(dart):
14-
`MyAppComponent(MyService myService, ...) { ... }`|`MyAppComponent(MyService myService, ...)`
1513
description:
16-
The class constructor is called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
14+
Called before any other lifecycle hook. Use it to inject dependencies, but avoid any serious work here.
1715

1816

1917
@cheatsheetItem
20-
syntax(ts dart):
18+
syntax(ts):
2119
`ngOnChanges(changeRecord) { ... }`|`ngOnChanges(changeRecord)`
2220
syntax(js):
2321
`ngOnChanges: function(changeRecord) { ... }`|`ngOnChanges: function(changeRecord)`
@@ -26,16 +24,16 @@ Called after every change to input properties and before processing content or c
2624

2725

2826
@cheatsheetItem
29-
syntax(ts dart):
27+
syntax(ts):
3028
`ngOnInit() { ... }`|`ngOnInit()`
3129
syntax(js):
3230
`ngOnInit: function() { ... }`|`ngOnInit: function()`
3331
description:
34-
Called after the constructor, initializing input properties, and the first call to ngOnChanges.
32+
Called after the constructor, initializing input properties, and the first call to `ngOnChanges`.
3533

3634

3735
@cheatsheetItem
38-
syntax(ts dart):
36+
syntax(ts):
3937
`ngDoCheck() { ... }`|`ngDoCheck()`
4038
syntax(js):
4139
`ngDoCheck: function() { ... }`|`ngDoCheck: function()`
@@ -44,16 +42,16 @@ Called every time that the input properties of a component or a directive are ch
4442

4543

4644
@cheatsheetItem
47-
syntax(ts dart):
45+
syntax(ts):
4846
`ngAfterContentInit() { ... }`|`ngAfterContentInit()`
4947
syntax(js):
5048
`ngAfterContentInit: function() { ... }`|`ngAfterContentInit: function()`
5149
description:
52-
Called after ngOnInit when the component's or directive's content has been initialized.
50+
Called after `ngOnInit` when the component's or directive's content has been initialized.
5351

5452

5553
@cheatsheetItem
56-
syntax(ts dart):
54+
syntax(ts):
5755
`ngAfterContentChecked() { ... }`|`ngAfterContentChecked()`
5856
syntax(js):
5957
`ngAfterContentChecked: function() { ... }`|`ngAfterContentChecked: function()`
@@ -62,16 +60,16 @@ Called after every check of the component's or directive's content.
6260

6361

6462
@cheatsheetItem
65-
syntax(ts dart):
63+
syntax(ts):
6664
`ngAfterViewInit() { ... }`|`ngAfterViewInit()`
6765
syntax(js):
6866
`ngAfterViewInit: function() { ... }`|`ngAfterViewInit: function()`
6967
description:
70-
Called after ngAfterContentInit when the component's view has been initialized. Applies to components only.
68+
Called after `ngAfterContentInit` when the component's view has been initialized. Applies to components only.
7169

7270

7371
@cheatsheetItem
74-
syntax(ts dart):
72+
syntax(ts):
7573
`ngAfterViewChecked() { ... }`|`ngAfterViewChecked()`
7674
syntax(js):
7775
`ngAfterViewChecked: function() { ... }`|`ngAfterViewChecked: function()`
@@ -80,7 +78,7 @@ Called after every check of the component's view. Applies to components only.
8078

8179

8280
@cheatsheetItem
83-
syntax(ts dart):
81+
syntax(ts):
8482
`ngOnDestroy() { ... }`|`ngOnDestroy()`
8583
syntax(js):
8684
`ngOnDestroy: function() { ... }`|`ngOnDestroy: function()`

modules/@angular/docs/cheatsheet/ngmodules.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,51 +7,52 @@ NgModules
77

88
@cheatsheetItem
99
syntax(ts):
10-
`@NgModule({ declarations: ..., imports: ..., exports: ..., bootstrap: ...})
10+
`@NgModule({ declarations: ..., imports: ...,
11+
exports: ..., providers: ..., bootstrap: ...})
1112
class MyModule {}`|`NgModule`
1213
description:
13-
Defines a module that contains components, directives, pipes and providers.
14+
Defines a module that contains components, directives, pipes, and providers.
1415

1516
syntax(js):
16-
`ng.core.NgModule({declarations: ..., imports: ..., exports: ..., bootstrap: ...}).
17+
`ng.core.NgModule({declarations: ..., imports: ...,
18+
exports: ..., providers: ..., bootstrap: ...}).
1719
class({ constructor: function() {}})`
1820
description:
19-
Defines a module that contains components, directives, pipes and providers.
21+
Defines a module that contains components, directives, pipes, and providers.
2022

2123
@cheatsheetItem
22-
syntax(ts js):
24+
syntax:
2325
`declarations: [MyRedComponent, MyBlueComponent, MyDatePipe]`|`declarations:`
2426
description:
25-
List of components, directives and pipes that belong to this module.
27+
List of components, directives, and pipes that belong to this module.
2628

2729
@cheatsheetItem
2830
syntax(ts):
2931
`imports: [BrowserModule, SomeOtherModule]`|`imports:`
3032
description:
31-
List of modules that are being imported into this module. Everything from the imported modules will
32-
be available to `declarations` of this module.
33+
List of modules to import into this module. Everything from the imported modules
34+
is available to `declarations` of this module.
3335

3436
syntax(js):
3537
`imports: [ng.platformBrowser.BrowserModule, SomeOtherModule]`|`imports:`
3638
description:
37-
List of modules that are being imported into this module. Everything from the imported modules will
38-
be available to `declarations` of this module.
39+
List of modules to import into this module. Everything from the imported modules
40+
is available to `declarations` of this module.
3941

4042
@cheatsheetItem
41-
syntax(ts js):
43+
syntax:
4244
`exports: [MyRedComponent, MyDatePipe]`|`exports:`
4345
description:
44-
List of components, directives and pipes that will be visible to modules that import this module.
46+
List of components, directives, and pipes visible to modules that import this module.
4547

4648
@cheatsheetItem
47-
syntax(ts js):
49+
syntax:
4850
`providers: [MyService, { provide: ... }]`|`providers:`
4951
description:
50-
Array of dependency injection providers visible to contents of this module as well as everyone
51-
importing this module.
52+
List of dependency injection providers visible both to the contents of this module and to importers of this module.
5253

5354
@cheatsheetItem
54-
syntax(ts js):
55+
syntax:
5556
`bootstrap: [MyAppComponent]`|`bootstrap:`
5657
description:
57-
Array of components to bootstrap when this module is bootstrapped.
58+
List of components to bootstrap when this module is bootstrapped.

0 commit comments

Comments
 (0)