Closed
Description
@gdi2290 and I were just troubleshooting an issue related to an observable pipe always emitting a null value because the observable reference being passed into the pipe never matched the already set observable instance. This was because the template was calling a method to return an observable, causing a new observable to be created on each lifecycle tick.
{{ someService.getObservable() | async }}
It would be nice to have the same one-time binding capability as AngularJS 1.x where bindings could be expressed as "bind once" inside of templates.
One option is to create a pipe to support this, where as soon as a non-undefined value is returned from the left-side, the once
pipe would cache and keep the reference:
{{ someService.getObservable() | once | async }}
Or we could add template sugar for this.
{{ ::someService.getObservable() | async}}