At least one root component connects a component hierarchy to every Angular application's page document object model. Each element also has an HTML template specifying the view displayed in the target environment and a class that holds the data and functionality of the application.
The @Component() decorator recognizes the class below it as a component and offers the template and other component-specific metadata.
Components are a logical part of an Angular application's code. A component is made up of the following elements:
For each Angular component you develop, you can define an HTML template and the CSS styles that go with it, including any selectors, rules, and media queries you need.
One way to achieve this is to use the styles property in the component metadata. The styles property receives an array of strings containing CSS code.