Exploring angular 6 with spring boot and encountering an issue with nested classes. Below is my code snippet but I'm facing difficulties in displaying users and getting an error. Can someone assist me?
export class Address {
street: string;
suite: string;
city: string;
zipcode: string;
}
import {Address} from './address';
export class User {
id: number;
name: string;
email: string;
address: Address;
phone: string;
website: string;
}
Sharing my html code below:
<form (ngSubmit)="onSubmit()" >
<div class="form-group">
<label for="id">User Id</label>
<input type="text" class="form-control" id="id" required [(ngModel)]="users.id" name="id">
</div>
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" required [(ngModel)]="users.name" name="name">
</div>
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" required [(ngModel)]="users.email" name="email">
</div>
<div class="form-group">
<label for ="street" >Address street</label>
<input type="text" class="form-control" id="street" required [(ngModel)]="users.address.street" name="street">
</div>