Class & Style Bindings
import { Component } from '@angular/core';
@Component({
selector: 'my-tutorials',
template: `<h2>{{title}}</h2>
<div [class.myClass]="applyClass">Apply Class</div><br>
<div [style.color]="applyBlue ? 'blue' : 'orange' ">This is style binding</div>`, /* If true then 'blue', else 'orange' */
styles: [`.myClass {
color: red;
}`]
})
export class TutorialsComponent{
public title = "Tutorials from Joatmon Channel";
public applyClass = false;
public applyBlue = false;
}