is there an equivalent of async pipe that you can use inside a component?

Discussão em 'Angular' iniciado por Lev, Fevereiro 24, 2025.

  1. Lev

    Lev Guest

    Does there exist something equivalent to the async pipe that I could use inside a component like this

    @Component({
    selector: 'my-component',
    })

    export class myComponent {

    myObservable$: Observable<string>;

    method() {
    doSomething(this.myObservable$);
    // here I would like to access directly the current string value of
    // myObservable$ without having to subscribe
    }
    }

    Continue reading...

Compartilhe esta Página