The Question:

How do you design a good style API for Angular Components using CSS and leave our Component Classes clean and free from styling logic?

(This article will cover some preliminary information, if you feel like skipping right to the bones, head down to the Solution, or you can check out the full code here: https://stackblitz.com/edit/angular-ivy-spi8xt?file=src/app/app.component.html)

The Definition:

Let us start by defining what a style API is. When creating UI components for a library or project. Having a consistent way to communicate with your components in order to style them or control their formatting is key. …


Angular’s DI is absolutely fantastic, but with all things, it is always fun to see if we can improve on what is already there. One of the things that always bothered me about the token injection is the lack of Typescript types that went along with it. It allows for a lot of flexibility that can end up biting you in larger projects.

For those of you who are familiar with @Inject() in Angular, know that you can use this to provide DI into different Angular Features. …


The Problem

Trying to get 2 distinct Angular applications onto a single HTML page. When you try to do this, you’ll notice that your 2nd application will not render.

I know most of you Angular gurus out there are asking why anyone would want to do this. Angular is an enterprise framework meant for building SPA’s not individual widgets. …

Nicholas Favero

CTO & Co-Founder at mTreatment

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store