I find myself writing code like this:
<div *ngIf="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff != null">
<span [ngStyle]="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.street1Style" *ngIf="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.street1.length > 0">{{globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.street1}}<br /></span>
<span *ngIf="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.street2.length > 0">{{globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.street2}}<br /></span>
<span *ngIf="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.city.length > 0">{{globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.city}},</span>
<span *ngIf="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.state.length > 0">{{globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.state}},</span>
<span *ngIf="globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.zip.length > 0">,{{globals.fieldErrors[item.jsonParent][item.jsonName].locationADiff.zip}}</span>
</div>
Is there a way to simplify that? I'd like to set a single variable, such as "myVar" equal to "globals.fieldErrors[item.jsonparent][item.jsonName]" to reduce verbosity.