I am following the documentation given in https://ng-bootstrap.github.io/#/components/toast/examples#howto-global here I can see in the toast-global.component.ts file:
import { Component, OnDestroy } from '@angular/core';
import { ToastService } from './toast-service';
@Component({ selector: 'ngbd-toast-global', templateUrl: './toast-global.component.html' })
export class NgbdToastGlobal implements OnDestroy {
constructor(public toastService: ToastService) {}
showStandard() {
this.toastService.show('I am a standard toast');
}
showSuccess() {
this.toastService.show('I am a success toast', { classname: 'bg-success text-light', delay: 10000 });
}
showDanger(dangerTpl) {
this.toastService.show(dangerTpl, { classname: 'bg-danger text-light', delay: 15000 });
}
ngOnDestroy(): void {
this.toastService.clear();
}
}
here in showSuccess() method it has been used like:
this.toastService.show('I am a success toast', { classname: 'bg-success text-light', delay: 10000 });
I need to change the color for success to alert-success(bootstrap class), I tried to put that as a value to classname but it is not working. Could someone please help me on this?