Angular Safe Navigation Operator, Dynamic Properties, and Bracket Designations

Angular 2 has a " safe navigation operator that allows you to reference potential undefined child properties in your components.

Is there a way to use this with dynamic properties and a bracket? eg.

<input [type]="text" [ngModel]="formValues?[control]">

Where controlis another variable from my component telling the template that forms the value to use, and formValues ​​is loaded async, so it could potentially be null.

+4
source share

Source: https://habr.com/ru/post/1671176/


All Articles