-import { Component, HostListener, Input } from '@angular/core';
+import { Component, EventEmitter, HostListener, Input, Output } from '@angular/core';
import { detect } from 'detect-browser';
@Input()
text?: string;
+ @Output()
+ toastSuccess = new EventEmitter<void>();
+
+ @Output()
+ toastError = new EventEmitter<void>();
+
icons = Icons;
constructor(private notificationService: NotificationService) {}
SUCCESS_TITLE,
CLIPBOARD_SUCCESS_MESSAGE
);
+ this.toastSuccess.emit();
};
const showError = () => {
this.notificationService.show(NotificationType.error, ERROR_TITLE, CLIPBOARD_ERROR_MESSAGE);
+ this.toastError.emit();
};
if (['firefox', 'ie', 'ios', 'safari'].includes(browser.name)) {
// Various browsers do not support the `Permissions API`.
}
} catch (_) {
this.notificationService.show(NotificationType.error, ERROR_TITLE, CLIPBOARD_ERROR_MESSAGE);
+ this.toastError.emit();
}
}
}