exercises

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

busy.component.ts (595B)


      1 import { Component, HostBinding, inject } from "@angular/core";
      2 import { BusyService } from "./busy.service";
      3 
      4 @Component({
      5     selector: "div.busy-indicator",
      6     templateUrl: "./busy.component.html",
      7     styleUrls: ["./busy.component.scss"],
      8     standalone: true
      9 })
     10 export class BusyIndicatorComponent {
     11     private busyService = inject(BusyService);
     12     
     13     @HostBinding("class.visible") get visible() {
     14         return this.busyService.busy();
     15     }
     16 
     17     get message() {
     18         return this.busyService.message();
     19     }
     20 
     21     get isVisible() {
     22         return this.busyService.busy();
     23     }
     24 }