TypeScript Tutorial #5 - Classes

preview_player
Показать описание
How do classes work in TypeScript?
Рекомендации по теме
Комментарии
Автор

Amazing guide! You took a dull subject and made it incredibly bright

yinonelbaz
Автор

Hey, nicely explained tutorial but it was missing information about build in option to create getters and setters for properties.

Using the example from your video instead of defining `getName()` we could create getter with following syntax:
`get name() { return this.name } `
Now when we call `devsage.name` it will invoke our getter.
Same thing goes for setter:
`set name(providedName: string) { this.name = providedName }`

Matysek
Автор

Yo!


I know this is a different video, but I had problems on a previous one. This is about your adblocker video. When I try to unpack my code onto chrome extensions, I get this message:

~\Documents\AdBlocker
Manifest is not valid JSON. Line: 1, column: 1, Unexpected token.

Please help me...

taco