import { Component , HostListener , ChangeDetectionStrategy } from '@angular/core' ; import { NzModalService , NzMessageService } from 'ng-zorro-antd' ; @ Component ( { selector : 'header-storage' , template : `
  <i nz-icon type="tool"></i>
  {{ 'menu.clear.local.storage' | translate}}
  ` , host : { '[class.d-block]' : 'true' , } , changeDetection : ChangeDetectionStrategy . OnPush } ) export class HeaderStorageComponent { constructor ( private confirmServ , private messageServ ) { } @ HostListener ( 'click' ) _click ( ) { this . confirmServ . confirm ( { nzTitle : 'Make sure clear all local storage?' , nzOnOk : ( ) => { localStorage . clear ( ) ; this . messageServ . success ( 'Clear Finished!' ) ; } , } ) ; } }