import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
}
<style>
.first {
background-color: #3471eb;
}
</style>
<h1>NgClass example in angular</h1>
<div [ngClass]="'first'">
Example 1
</div>
Output:
No comments:
Post a Comment