Unfortunately it evaluates to undefined.
<div *ngIf="offer.exp && offer.exp['4334']">ok</div>
Looks like the pipe is the most flexible way to go.
On Tuesday, July 19, 2016 at 12:17:24 AM UTC-7, Sander Elias wrote:
>
> Hi P. Steven,
>
> You can use && to cater to your use-case.
> like:
> {{myBlah && myBlah['test']}}
>
> its much lighter as a pipe, and doesn't need to add the properties to your
> bare classes.
>
> Regards
> Sander
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.