import { Component, OnDestroy, OnInit } from '@angular/core'; import { JhiAlertService } from 'ng-jhipster'; @Component({ selector: 'jhi-alert', template: ` ` }) export class JhiAlertComponent implements OnInit, OnDestroy { alerts: any[]; constructor(private alertService: JhiAlertService) {} ngOnInit() { this.alerts = this.alertService.get(); } ngOnDestroy() { this.alerts = []; } }