argos/dmp-frontend/src/app/shared/components/notificaiton/snack-bar-notification.comp...

22 lines
666 B
TypeScript
Raw Normal View History

2017-12-14 11:41:26 +01:00
import { TranslateService } from '@ngx-translate/core';
import { Component, Inject } from '@angular/core';
import { MAT_SNACK_BAR_DATA } from '@angular/material';
@Component({
selector: 'snack-bar-notification',
templateUrl: 'snack-bar-notification.component.html'
})
export class SnackBarNotificationComponent {
message: string;
constructor( @Inject(MAT_SNACK_BAR_DATA) public data: any) {
this.parseMessage(data.message, data.language);
}
parseMessage(message: any, language: TranslateService): void {
2018-01-23 16:21:38 +01:00
if(language) language.get(message).subscribe((value: string) => {
2017-12-14 11:41:26 +01:00
this.message = value;
});
2018-01-23 16:21:38 +01:00
else this.message = message;
2017-12-14 11:41:26 +01:00
}
}