mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
Create missing markdown files for cdk items. (#6770)
This commit is contained in:
committed by
tinayuangao
parent
1b6b270551
commit
ffa4d9dcff
@@ -0,0 +1,2 @@
|
||||
### FocusKeyManager
|
||||
`ListKeyManager` manages the focus of an item based on keyboard interaction.
|
||||
@@ -0,0 +1,3 @@
|
||||
### Coercion
|
||||
|
||||
Utility functions for coercing `@Input`s into specific types.
|
||||
@@ -0,0 +1,3 @@
|
||||
### Collections
|
||||
|
||||
A set of utilities for managing collections.
|
||||
@@ -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++;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -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>
|
||||
```
|
||||
@@ -0,0 +1,3 @@
|
||||
### Overlay
|
||||
|
||||
A service used to manage overlays.
|
||||
@@ -0,0 +1,3 @@
|
||||
### Platform
|
||||
|
||||
A service for determing the current platform.
|
||||
@@ -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(...);
|
||||
```
|
||||
@@ -0,0 +1,3 @@
|
||||
### Scrolling
|
||||
|
||||
Some things to help with scrollling.
|
||||
@@ -0,0 +1,3 @@
|
||||
### Viewport
|
||||
|
||||
A utility for getting the bounds of the browser viewport.
|
||||
Reference in New Issue
Block a user