The button is clicked
===== servers.component.ts=====
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-servers',
templateUrl: './servers.component.html',
styleUrls: ['./servers.component.css']
})
export class ServersComponent implements OnInit {
bIsBackgroundRed: boolean;
constructor() {
}
ngOnInit() {
this.bIsBackgroundRed = false;
}
onButtonClicked() {
this.bIsBackgroundRed = true;
}
}
===== servers.component.css =====
.redBackground{
background: indianred;
}
.greenBackground{
background:greenyellow;
}