What is the meaning of question mark in expressions in Angular 2?

Edit

Since the original answer, Ecmascript, and Typescript (in 3.7) have both added the ?. (called the optional chaining operator) operator. See the PR for details.

Original answer

This is not a Typescript operator. Angular 2 has a safe navigation operator in templates.

values?.listArray

is equivalent to

values != null ? values.listArray: null

More info here and here

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)