如何private
在 Angular 4 中绑定属性?
export class newItem{
private id: number;
private description: string;
private insertDate: any;
get getId() : number {
return this.id;
}
set setId(name : number) {
this.id = name;
}
get getDescription() : string {
return this.description;
}
set setDescription(description : string) {
this.description = description;
}
get getInsertDate() : string {
return this.insertDate;
}
set setInsertDate(insertDate : string) {
this.insertDate = insertDate;
}
这里
它抛出Cannot assign to 'getInsertDate' because it is a constant or a read-only property.