In an Angular project, I am using an interface.
export interface School {
name: string = '';
website: string;
registrationNumber: string;
dateEstablished: Date;
address: string;
country: [];
companyLogo: any = '';
clear() {
this.name = '';
this.website = '';
this.registrationNumber = '';
this.dateEstablished = null;
this.address = '';
this.country = [];
this.companyLogo = '';
}
}
I got two errors:
-
Object is possibly 'undefined' - and all the "this." highlighted
-
Declaration or statement expected.ts(1128) - and the last closing curly brace highlighted.
-
expected call-signature: 'clear' to have a typedef (typedef)tslint(typedef)
How do I get these resolve?
Thanks