i am working with dyanmic array.. i have a model class .. this i have assign ass array.. but when i bind getting error like ngFor can only iterate array.. Cant identify where i went wrong.. can anybody help me?
Model.ts
export class AddDriver {
constructor(
public additionalDriverId: string,
public additionalDriverName: string,
public IDNumber: string,
public dob: NgbDate,
public age: string,
public gender: string,
public licenseIssuedDate: NgbDate,
public licenseExpiryDate: NgbDate,
public issuedCountry: string,
public nationality: string,
public relationship: string
) {}
}
component.ts
addDriverArray: Array = [];
newDynamic: any = [];
this.newDynamic = [{
additionalDriverId: '', additionalDriverName: '', IDNumber: '', dob: '', age: '', gender: '', licenseIssuedDate: '', licenseExpiryDate: '', issuedCountry: '',
nationality: '', relationship: ''
}];
this.addDriverArray.push(this.newDynamic);
Get n8n VPS hosting 3x cheaper than a cloud solution
Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)