core/src/rxjs/observe/abstraction/observe-array-base.directive.ts
The base class for *observe directives combining observables using an array of observable values (i.e. [x$, y$]).
Properties |
|
Methods |
|
Outputs |
| completeCalled | |
Type : EventEmitter<void>
|
|
|
Inherited from
ObserveBaseDirective
|
|
|
Defined in
ObserveBaseDirective:81
|
|
|
Triggered when the observable completes. |
|
| errorCalled | |
Type : EventEmitter<>
|
|
|
Inherited from
ObserveBaseDirective
|
|
|
Defined in
ObserveBaseDirective:75
|
|
|
Triggered when an error occurs in the observable's pipeline. |
|
| nextCalled | |
Type : EventEmitter<TResolved>
|
|
|
Inherited from
ObserveBaseDirective
|
|
|
Defined in
ObserveBaseDirective:69
|
|
|
Triggered whenever the observable emits a value. |
|
| Protected createViewContext | |||||
createViewContext(undefined: literal type)
|
|||||
|
Inherited from
ObserveBaseDirective
|
|||||
|
Parameters:
Returns:
TContext
|
|||||
| ngOnInit |
ngOnInit()
|
|
Inherited from
ObserveBaseDirective
|
|
Returns:
void
|
| Protected Abstract observeInput | ||||||||
observeInput(input: TInput)
|
||||||||
|
Inherited from
ObserveBaseDirective
|
||||||||
|
Takes the input passed to the directive (which might be an observable, a map or an array of observable for example) and creates an observable that combines and represents all the observables in the value. Intended for applying functions like
Parameters:
Returns:
Observable<TResolved>
An observable which combines and represents all the observables in the input value. |
||||||||
| ngOnDestroy |
ngOnDestroy()
|
|
Inherited from
Destroyable
|
|
Returns:
void
|
| Protected subscribe | ||||||||||||||||||||
subscribe(observable: Observable
|
||||||||||||||||||||
|
Inherited from
Destroyable
|
||||||||||||||||||||
Type parameters:
|
||||||||||||||||||||
|
Subscribes to an observable and stores the subscription for automatic disposal.
When
Parameters:
Returns:
Subscription
The subscription created for the observable. |
||||||||||||||||||||
| Protected Readonly input |
Type: BehaviorSubject<TInput | null>
|
Default value: new BehaviorSubject(null as TInput | null)
|
|
Inherited from
ObserveBaseDirective
|
Why BehaviorSubject<s | null> and not Subject<TInput>
This leads to subscribing in ngOnInit, to allow Angular time to initialize those.
BUT, if |
| Protected Abstract Readonly selector |
Type: string
|
|
Inherited from
ObserveBaseDirective
|
|
The selector defined for the directive extending this class. Will be used to create a corresponding
property in the view context in order to make the micro-syntax |
| Protected Readonly destroyed |
Type: Subject<void>
|
Default value: new Subject()
|
|
Inherited from
Destroyable
|
|
Emits a value when |
| Protected Readonly subscriptions |
Type: Subscription
|
Default value: new Subscription()
|
|
Inherited from
Destroyable
|
|
A list of all subscriptions manually added using the |
import { Directive } from '@angular/core';
import { ObserveBaseDirective } from './observe-base.directive';
import { ResolvedObserveContext } from './types/general';
import { ObservableArray } from './types/arrays';
/**
* The base class for `*observe` directives combining observables using an array of observable values (i.e. [x$, y$]).
*
* @export
* @abstract
* @class ObserveArrayDirective
* @extends {ObserveBaseDirective<TInput, TResolved, TContext>}
* @template TInput The type of observable array.
* @template TResolved The type of resolved array.
* @template TContext The the of context the directive will provide to the view.
*/
@Directive()
export abstract class ObserveArrayDirective<TInput extends ObservableArray, TResolved, TContext extends ResolvedObserveContext<TResolved> = ResolvedObserveContext<TResolved>>
extends ObserveBaseDirective<TInput, TResolved, TContext>
{
}