Creating the first component
Angular is based on components. Components are built with other components and normal HTML tags. Our application will have three components: the forecast page, the about page, and the whole widget. The widget itself, which is referenced in the HTML page, will use the other two widgets.
The widget will show the About page in the third tab, as you can see in the following screenshot:
The forecast component is shown in the first tab of the following screenshot. We will create the forecast and the widget later in this chapter.
The template
A component is a class decorated with some metadata. Decorators are functions that ...
Get TypeScript: Modern JavaScript Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.