How to Generate Getter and Setter for Typescript in VSCode

In this post, I show you how to auto-generate 'get' and 'set' accessors for TypeScript class in VisualStudio. The VisualStudio provides the refactor feature, this refactoring lets you quickly encapsulate a field in JavaScript and TypeScript.

Below gif image shows you how to auto-generate 'get' and 'set' accessors for TypeScript class in VisualStudio:


1. Select property.
2. Right click on selected property and choose Refactor option
3. Click on get and set accessors.

Reference


Free Spring Boot Tutorial | Full In-depth Course | Learn Spring Boot in 10 Hours


Watch this course on YouTube at Spring Boot Tutorial | Fee 10 Hours Full Course

Comments