• 개요
@angular/core/rxjs-interop

outputFromObservable

초기화 API
안정화v19.0부터

Declares an Angular output that is using an RxJS observable as a source for events dispatched to parent subscribers.

The behavior for an observable as source is defined as followed:

  1. New values are forwarded to the Angular output (next notifications).
  2. Errors notifications are not handled by Angular. You need to handle these manually. For example by using catchError.
  3. Completion notifications stop the output from emitting new values.

API

    
      
    
    

outputFromObservable

OutputRef<T>
@paramobservableObservable<T>
@paramoptsOutputOptions | undefined
@returnsOutputRef<T>
사용 시 참고사항

Initialize an output in your directive by declaring a class field and initializing it with the outputFromObservable() function.

@Directive({..})
export class MyDir {
  nameChange$ = <some-observable>;
  nameChange = outputFromObservable(this.nameChange$);
}

사용 시 참고사항

Initialize an output in your directive by declaring a class field and initializing it with the outputFromObservable() function.

@Directive({..})
export class MyDir {
  nameChange$ = <some-observable>;
  nameChange = outputFromObservable(this.nameChange$);
}
상세 내용으로 이동