Health checks in Angular
It’s now time to build an Angular component that is capable of fetching and displaying the structured JSON data we managed to pull off in the previous sections.
As we know from Chapter 3, Looking Around, an Angular component is commonly made of four separate files, as follows:
- The component (
.ts
) file, written in TypeScript and containing thecomponent
class, together with all the module references, functions, variables, and so on - The template (
.html
) file, written in HTML and extended with the Angular template syntax, which defines the UI layout architecture - The style (
.css
) file, written in CSS and containing the Cascading Style Sheets rules and definitions for drawing the UI - The test (
.spec.ts
) file, written in TypeScript and containing the tests that will be run by Karma
Although the aforementioned four-files approach is arguably the most practical one, the only required file is the component one...