Create missing markdown files for cdk items. (#6770)

This commit is contained in:
Joey Perrott
2017-09-06 10:10:29 -07:00
committed by tinayuangao
parent 1b6b270551
commit ffa4d9dcff
10 changed files with 85 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
### FocusKeyManager
`ListKeyManager` manages the focus of an item based on keyboard interaction.
+3
View File
@@ -0,0 +1,3 @@
### Coercion
Utility functions for coercing `@Input`s into specific types.
+3
View File
@@ -0,0 +1,3 @@
### Collections
A set of utilities for managing collections.
+26
View File
@@ -0,0 +1,26 @@
### KeyCodes
Commonly used keycode constants.
#### Example
```ts
import {Directive} from '@angular/core';
import {UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW} from '@angular/cdk/keycodes';
@Directive({
selector: '[count-arrows]'
host: {
(keypress): 'handleKeyPress($event)'
}
})
export class ArrowCounterDirective {
arrowPressCount = 0;
handleKeyPress(event: KeyboardEvent) {
if ([UP_ARROW, DOWN_ARROW, LEFT_ARROW, RIGHT_ARROW].includes(event.keyCode)) {
this.arrowPresscount++;
}
}
}
```
+12
View File
@@ -0,0 +1,12 @@
### Observers
A directive for observing when the content of the host element changes. An event is emitted when a
mutation to the content is observed.
#### Example
```html
<div class="projected-content-wrapper" (cdkObserveContent)="projectContentChanged()">
<ng-content></ng-content>
</div>
```
+3
View File
@@ -0,0 +1,3 @@
### Overlay
A service used to manage overlays.
+3
View File
@@ -0,0 +1,3 @@
### Platform
A service for determing the current platform.
+27
View File
@@ -0,0 +1,27 @@
### RxJS Usage
When dealing with RxJS operators it is important to be aware that using the "patch" imports will
pollute the global Observable object (e.g. `import "rxjs/add/operator/map"`). When creating a
component library, it is highly recommended to import the operator functions directly (e.g.
`import "rxjs/operator/map"`):
```ts
// NO
import 'rxjs/add/operator/map';
someObservable.map(...).subscribe(...);
// YES
import {map} from 'rxjs/operator/map';
map.call(someObservable, ...).subscribe(...);
```
#### RxChain
Because this approach can be inflexible when dealing with long chains of operators. You should use
the `RxChain` class to help with it:
```ts
// Before
someObservable.filter(...).map(...).do(...);
// After
RxChain.from(someObservable).call(filter, ...).call(map, ...).subscribe(...);
```
+3
View File
@@ -0,0 +1,3 @@
### Scrolling
Some things to help with scrollling.
+3
View File
@@ -0,0 +1,3 @@
### Viewport
A utility for getting the bounds of the browser viewport.