Skip to content

Commit b415e25

Browse files
committed
Create missing markdown files for cdk items.
1 parent 70bd5fc commit b415e25

File tree

10 files changed

+94
-0
lines changed

10 files changed

+94
-0
lines changed

src/cdk/a11y/focus-key-manager.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### FocusKeyManager
2+
`ListKeyManager` manages the focus of an item based on keyboard interaction.

src/cdk/coercion/coercion.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Coercion
2+
3+
Utility functions for coercing `@Input`s into specific types.

src/cdk/collections/collections.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Collections
2+
3+
A set of utilities for managing collections.

src/cdk/keycodes/keycodes.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
### KeyCodes
2+
3+
Commonly used keycode constants.
4+
5+
#### Example
6+
```ts
7+
import {Directive} from '@angular/core';
8+
import {UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW} from '@angular/cdk/keycodes';
9+
10+
@Directive({
11+
selector: '[count-arrows]'
12+
host: {
13+
(keypress): 'handleKeyPress($event)'
14+
}
15+
})
16+
export class ArrowCounterDirective {
17+
arrowPressCount = 0;
18+
19+
handleKeyPress(event: KeyboardEvent) {
20+
if (event.codeCode in [UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW]) {
21+
this.arrowPresscount++;
22+
}
23+
}
24+
}
25+
```
26+

src/cdk/observers/observers.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### Observers
2+
3+
A directive for observing when the content of the host element changes. An event is emitted when a
4+
mutation to the content is observed.
5+
6+
#### Example
7+
8+
```html
9+
<div class="projected-content-wrapper" (cdkObserveContent)="projectContentChanged()">
10+
<ng-content></ng-content>
11+
</div>
12+
```

src/cdk/overlay/overlay.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Overlay
2+
3+
A component used to manage overlays.

src/cdk/platform/platform.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Platform
2+
3+
A service for determing the current platform.

src/cdk/rxjs/rxjs.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
### RxJS Usage
2+
When dealing with RxJS operators, it is best to import the operator functions directly (e.g.
3+
`import "rxjs/operator/map"`), as opposed to using the "patch" imports which pollute the global Observable object (e.g. `import "rxjs/add/operator/map"`):
4+
5+
```ts
6+
// NO
7+
import 'rxjs/add/operator/map';
8+
someObservable.map(...).subscribe(...);
9+
10+
// YES
11+
import {map} from 'rxjs/operator/map';
12+
map.call(someObservable, ...).subscribe(...);
13+
```
14+
15+
#### RxChain
16+
Because this approach can be inflexible when dealing with long chains of operators. You should use the `RxChain` class to help with it:
17+
18+
```ts
19+
// Before
20+
someObservable.filter(...).map(...).do(...);
21+
22+
// After
23+
RxChain.from(someObservable).call(filter, ...).call(map, ...).subscribe(...);
24+
```
25+
26+
#### Available Operators
27+
Many operators are provided in via the `RxChain`, these operators include:
28+
- `auditTime`
29+
- `debounceTime`
30+
- `filter`
31+
- `finallyOperator`
32+
- `first`
33+
- `map`
34+
- `startWith`
35+
- `switchMap`
36+
- `takeUntil`

src/cdk/scrolling/scrolling.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Scrolling
2+
3+
Some things to help with scrollling.

src/cdk/scrolling/viewport.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Viewport
2+
3+
A utility for getting the bounds of the browser viewport.

0 commit comments

Comments
 (0)