Assembling the Stopwatch

Let's assemble everything that we have built in the previous lessons to create a full-fledged stopwatch application.

Stopwatch application

All three observables have been created. Now it’s time to assemble everything into an actual program.

Bud1
x.html
index.htmlIlocblob;(ÿÿÿÿÿÿpackage-lock.jsonIlocblob©(ÿÿÿÿÿÿpackage.jsonIlocblob(ÿÿÿÿÿÿpackage.json.sb-a48e3b48-LE4G1wIlocblob˜ÿÿÿÿÿÿstopwatch-complete.tsIlocblob…(ÿÿÿÿÿÿstopwatch.tsIlocblobó(ÿÿÿÿÿÿ
tsconfig.jsonIlocblob;˜ÿÿÿÿÿÿwebpack.config.jsIlocblob©˜ÿÿÿÿÿÿ @€ @€ @€ @E
DSDB `€ @€ @€ @
Stopwatch application project

🙋‍♂️ Joe asks: What does that <HTMLElement> mean?

This course uses TypeScript for all the examples. The <angle bracket notation> denotes the specific return type for querySelector. TypeScript knows that querySelector will return some kind of element. In this case, we know specifically that we’re querying for an element of the HTML variety, so we use this syntax to override the generic element. With that override, TypeScript now knows that resultsArea has properties specific to an HTMLElement ...