I have an observable that returns a custom object - I want to use the async
pipe to get a property out of the object in the observable. When I use the following syntax, the <input />
value is just [object Object]?.color
<input type="text" value="{{myObservable$ | async}}?.color"></input>
You can solve this by
Property binding
<input type="text" [value]="(myObservable$ | async)?.color"></input>
Template expression
<input type="text" value="{{*myObservable$ | async).?.color}}"></input>
in your question
?.color
was not part of the template expression
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments