import { Component , Input , HostBinding , ChangeDetectionStrategy , ChangeDetectorRef } from '@angular/core' ; import { coerceBooleanProperty } from 'ngx-tethys/util' ; @ Component ( { selector : 'thy-loading' , templateUrl : './loading.component.html' , changeDetection : ChangeDetectionStrategy . OnPush } ) export class ThyLoadingComponent { public isDone : boolean ; public tip : string ; public isMask : boolean ; @ Input ( ) set thyDone ( value ) { this . isDone = coerceBooleanProperty ( value ) ; this . changeDetectorRef . markForCheck ( ) ; } @ Input ( ) set thyTip ( value ) { this . tip = value ; this . changeDetectorRef . markForCheck ( ) ; } @ Input ( ) set thyIsMask ( value ) { this . isMask = coerceBooleanProperty ( value ) ; this . changeDetectorRef . markForCheck ( ) ; } @ HostBinding ( 'class.thy-loading' ) loadingClassName = true ; constructor ( private changeDetectorRef ) { } }