【Angular】问题Property ‘XXX‘ comes from an index signature, so it must be accessed with [‘XXX‘]_angular.js


如图所示,问题代码如下

<p *ngIf="valiDataForm.get('password')?.errors?.msg">{{valiDataForm.get('password')?.errors?.msg}}</p>

修改为

<p *ngIf="valiDataForm.get('password')?.errors?.['msg']">{{valiDataForm.get('password')?.errors?.['msg']}}</p>