Forget about "| async", just use the elvis operator as {{costumer?.name}} Then initiate your component in the ngOnInit (or ngAfterViewInit), as doing this in the constructor won't be enough (you won't get the result of the promise).
By the way think about a store build with an Angular service to embed your costumer {{store.costumer?.name}} You will then be able to share this service between many components in a two-way data binding fashion : the change of the store.costumer in one component will natively propagate to all the other components using the store. Le jeudi 24 octobre 2019 23:43:40 UTC+2, Nhut Thai Le a écrit : > > > Hello, > > I have a template as follow: > <ion-content> > <h3>Account#: {{ (customer | async)?.accountNo }}</h3> > <h3>CustId: {{ (customer | async)?.id }}</h3> > <h3>Name: {{ (customer | async)?.name }}</h3> > <ion-button (click)="setDefault(customer)"> > Set As Default > </ion-button> > </ion-content> > > the customer is a Promise<Customer> that was retrieved earlier from a > service call. So the properties of the Customer will displayed once the > promise resolved. However, the promise is currently passed as is to the > click handler, is there anyway i can pass the value of the promise only? > something like (click)="setDefault(customer | async)" <------this doesnt > work because pipe cause compilation error when used inside event binding > -- You received this message because you are subscribed to the Google Groups "Angular and AngularJS discussion" group. To unsubscribe from this group and stop receiving emails from it, send an email to angular+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/angular/eb9dc113-4e60-4492-8110-9f556786ff49%40googlegroups.com.