6 ways to dynamically style Angular components
<p>Writing style that updates based on a component’s state is a <em>really</em> common pattern on the web. There are several ways to dynamically update your styling depending on what you want to do. Let’s look at a few.</p>
<h1>Class and Style directives</h1>
<h2>Using <code>ngClass</code></h2>
<p>The simplest way to update the style of your component is by using <code>ngClass</code>. This directive can dynamically add or change the class name of an element within your component. Let's imagine we have a button element that we want to mark as primary or secondary. We can write the following:</p>
<p><a href="https://medium.com/swlh/6-ways-to-dynamically-style-angular-components-b43e037852fa"><strong>Visit Now</strong></a></p>
<p> </p>