Hey guys so I had this working where I just pass the location.address and I read it in the OrderLoc now I am trying to do a whole location object such as value={{location}} but something is going wrong because I think the object end's up being empty as at a later time when I try to do OrderLoc.address I am getting undefined
<h3 *ngIf="!locations">You have no route assigned for today.</h3>
<mat-radio-group [(ngModel)]="OrderLoc" (ngModelChange)="emitAddress()" color="primary" aria-label="Select an option">
<mat-card *ngFor="let location of locations" style="cursor: pointer;" fxLayoutAlign="start center" style="cursor: pointer;margin-bottom: 20px;">
<mat-radio-button (click)='selected()' value={{location.address}}>
<div mat-line>{{location.name}}</div>
<div mat-line> {{location.address}} </div>
<div mat-line> {{location.postcode}} </div>
</mat-radio-button>
</mat-card>
</mat-radio-group>
Example with the whole object passed into value
<h3 *ngIf="!locations">You have no route assigned for today.</h3>
<mat-radio-group [(ngModel)]="OrderLoc" (ngModelChange)="emitAddress()" color="primary" aria-label="Select an option">
<mat-card *ngFor="let location of locations" style="cursor: pointer;" fxLayoutAlign="start center" style="cursor: pointer;margin-bottom: 20px;">
<mat-radio-button (click)='selected()' value={{location}}>
<div mat-line>{{location.name}}</div>
<div mat-line> {{location.address}} </div>
<div mat-line> {{location.postcode}} </div>
</mat-radio-button>
</mat-card>
</mat-radio-group>