ng-alert
Version:
Simple Alert module for Angular version 2 and above.
26 lines (19 loc) • 505 B
text/typescript
import { Component, OnInit } from '@angular/core';
import { Alert } from '../alert';
import { AlertService } from '../alert.service';
({
selector: 'ng-alert',
templateUrl: './alert.component.html',
styleUrls: ['./alert.component.css']
})
export class AlertComponent implements OnInit {
constructor(private alertService: AlertService) { }
ngOnInit() {
}
get alerts() {
return this.alertService.alerts;
}
remove(alert:Alert){
this.alertService.remove(alert);
}
}