I had ng2-Toasty implemented in my old Angular 5 application. I am trying to use ngx-toastr since ng2-Toasty doesnt support Aungular 8.
If you see below , the ngx-toastr doesnt seem to have an equivalent of ToastData
ng2-toasty
import { ToastyService, ToastyConfig, ToastOptions, ToastData } from 'ng2-toasty';
ngx-toastr
import { ToastrService, ToastConfig, ToastOptions} from 'ngx-toastr';
This is how it was used previously in code
var timeOutSeconds = message.timeOutSeconds ? message.timeOutSeconds * 1000 : 4000;
let toastOptions: ToastOptions = {
title: message.summary,
msg: message.detail,
timeout: isSticky ? 0 : timeOutSeconds
};
if (isSticky) {
toastOptions.onAdd = (toast: ToastData) => this.stickyToasties.push(toast.id);
toastOptions.onRemove = (toast: ToastData) => {
let index = this.stickyToasties.indexOf(toast.id, 0);
if (index > -1) {
this.stickyToasties.splice(index, 1);
}
toast.onAdd = null;
toast.onRemove = null;
};
}
Any idea what is the equivalent implementation using ngx-toastr