This project demonstrates how to create a simple web application using vanilla JavaScript to implement custom web components. The application includes three custom components, CountButton, SubtractButton, and Wrapper, that allow the user to increment and decrement a counter value displayed on the webpage.
The CountButton component is a custom web component that displays a button. When the button is clicked, it emits a custom event ('increment-clicked') to indicate that the count should be incremented.
The SubtractButton component is another custom web component that displays a button. When the button is clicked, it emits a custom event ('decrement-clicked') to indicate that the count should be decremented.
The Wrapper component acts as a wrapper for the CountButton and SubtractButton components. It demonstrates how to include one component inside another.
Start the Node.js server:
node server.js
This project is inspired by the concept of web components, providing a way to encapsulate functionality and create reusable components for web applications using vanilla JavaScript.