To further reduce the amount of code for Web Components I suggest some smart enhancements. By using decorators you can make the code even easier to read. That’s the power of TypeScript. All examples in this chapter are written in TypeScript.
Before you start reading this chapter, it’s recommended to get familiar with decorators in JavaScript and TypeScript.
Smart Selectors
When you work with the DOM, you often need to use querySelector and querySelectorAll. Most of the dynamics of components are in ...