Descripción
Create a TypeScript class with getter and setter methods
File Template: ❌
Prefix
class:getset
Scopes
typescript
Snippet de código
class ${1:MyClass} {
private _${2:attr}: ${3:string};
constructor($2: $3) {
this._$2 = $2;
}
get $2(): $3 {
return this._$2;
}
set $2(value: $3): void {
this._$2 = value;
}
}