OpenSlides/client/src/app/site/alert.component.ts
FinnStutzenstein 3f78ba1f3d Structural changes:
- AuthenticationService->AuthService
- removed underscore-directories
- put site related stuff into site/
- same for projector
- auth service went into a core/ directory, used by site and projector
- the alert is now not global anymore. Every view can have its own alert
- make the auth service query users/whoami for the current user
- made a new OpenSlides service for managing the startup
... A lot todo ...
2018-08-15 10:19:45 +02:00

35 lines
861 B
TypeScript

import { Component, OnInit, Input } from '@angular/core';
import { Alert, AlertType } from './alert';
@Component({
selector: 'alert',
templateUrl: './alert.component.html',
styleUrls: ['./alert.component.css']
})
export class AlertComponent implements OnInit {
@Input() alert: Alert;
constructor() { }
ngOnInit() { }
removeAlert(alert: Alert) {
this.alert = undefined;
}
cssClass(alert: Alert) {
// return css class based on alert type
switch (alert.type) {
case AlertType.Success:
return 'alert alert-success';
case AlertType.Error:
return 'alert alert-danger';
case AlertType.Info:
return 'alert alert-info';
case AlertType.Warning:
return 'alert alert-warning';
}
}
}