InterviewSolution
| 1. |
What is the safe navigation operator in Angular 6? |
|
Answer» In ANGULAR 2, the Safe navigation operator can be used to prevent errors while trying to access the object properties of non-existent objects. {{ phone?.number }} This above LINE of CODE only evaluates the number when the phone is not null or UNDEFINED. This is very suitable in situations where a phone is something that is loading asynchronously. Exampleclass PageTest { |
|