UNPKG

angular2-boiler-plate

Version:

Angular 2 Boiler plate that integrated with WebPack, TypeScript, DatePicker, RxJs for Reactive Extensions in Java Script , Karma , Jasmine for unit testing , WebKit ,protractor e2e testing

41 lines (36 loc) 1.13 kB
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core'; @Component({ selector: 'sui-alert', templateUrl: './sui.alert.component.html', }) export class Alertomponent implements OnInit { @Input() message: string; @Input() type: AlertType; @Input() heading: string; @Input() headerClass: string; @Input() messageClass: string; @Input() alertClass: string; @Input() alertStyle: Object={}; @Input() headingtStyle: Object={}; @Input() messagetStyle: Object={}; isClosed: boolean = false; cssClass: string = ''; onClose(event: any) { this.isClosed = true; } ngOnInit() { if (this.type === AlertType.success) { this.cssClass = 'sui-success'; } else if (this.type === AlertType.error) { this.cssClass = 'sui-danger'; } else if (this.type === AlertType.info) { this.cssClass = 'sui-info'; } this.cssClass = this.cssClass + ' ' + this.alertClass; } } export enum AlertType { success = 0, error = 1, info = 2 }