0
ES6을 사용하여 객체를 가져 와서 내 변수에 값을 제공하는 함수 및 일부 변수를 정의하는 클래스가 있습니다. 이것은 반복적 인 것이므로이를 달성하기 위해 구조 조정을 사용할 수있는 방법이 있습니까?클래스 멤버에 대한 객체 소멸
class BasicDataMgmt {
public id: number;
public name: string;
public email: string;
public phone: string;
public type: string;
fetchData(data) {
this.id = data.id;
this.name = data.name;
this.email = data.email;
this.phone = data.phone;
this.type = data.type;
}
}