Web APIs for Angular

Alexander Inkin
AngularWave

--

Web is a rich ecosystem with a bunch of powerful APIs that keeps getting bigger. There are things we are used to like Canvas or IntersectionObserver, but the ever growing list of browsers capabilities now includes Web MIDI API, Speech Recognition and even more exotic things like gamepads and VR. Naturally, they might be hard to use in Angular applications due to different paradigms of native JavaScript and declarative Angular nature. This is where we come in!

What is it?

Web APIs for Angular is an open source initiative me and Roman started a long time ago. If you follow our tech writing, you know that we are devoted advocates of the Angular way of doing things. We love declarative idiomatic approach and try to promote it wherever it is applicable. So at some point we looked at Web APIs page on MDN and decided why don’t we make it easier to use those in Angular. I started with Web Audio API, because that subject fascinated me. We also noticed that with only the DOCUMENT token at our disposal it is not easy to work with other global objects, such as window or navigator in safe DI fashion. So we have created what would then become the most popular library of the set — @ng-web-apis/common, a collection of tokens for global objects. This made them easy to test and use in Server Side Rendering, thanks to a sister package @ng-web-apis/universal.

--

--

Alexander Inkin
AngularWave

Passionate Angular dev, musician and OSS author 🌲 taiga-ui.dev ··· 🎹 jamigo.app