angular2-simple-ui
Version:
Angular 2 Simple Material Design UI Components customisable with Simple 30 KB CSS with LESS support and full features support , just plugin up and run for clarity look at sample examples
42 lines (36 loc) • 1.12 kB
text/typescript
import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';
export class AlertComponent {
message: string;
type: AlertType;
heading: string;
headerClass: string;
messageClass: string;
alertClass: string;
alertStyle: Object = {};
headingtStyle: Object = {};
messagetStyle: Object = {};
cssClass: string = '';
onClose(event: any) {
this.message = '';
}
getClass() {
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;
return this.cssClass;
}
}
export enum AlertType {
success = 0,
error = 1,
info = 2
}