Closed alienriquebm closed 7 years ago
Hello, same problem here. I'm on Angular4.
When I call the service in my onInit component, the toasty is not displayed.
I use this code:
ngOnInit(): void {
this._toastyConfig.theme = 'bootstrap';
let toastOptions: ToastOptions = {
title: 'title',
msg: 'my message',
showClose: true,
timeout: 15000,
theme: "bootstrap",
onAdd: (toast: ToastData) => {
console.log('Toast ' + toast.id + ' has been added!');
},
onRemove: function (toast: ToastData) {
console.log('Toast ' + toast.id + ' has been removed!');
}
};
this._toastyService.success(toastOptions);
};
In the console we can see that the onAdd console.log()
message is displayed but the toasty doesn't appear and no error in the console.
And after 15 seconds (my config), no other console.log()
is called from onRemove.
Thanks
Well... we need to wait for @akserg if can help us with this problem.
I'm submitting a ... [x] bug report [ ] feature request [ ] question about the decisions made in the repository
Do you want to request a feature or report a bug?
Bug
What is the current behavior? Hi my friend, thanks for your great work for all the comunnity. I have a problem when i request to show a toast on the ngOnInit method:
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar.
On the constructor:
private toastyService:ToastyService
What is the expected behavior? To show the toasty on the ngOnInit() of my class
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
Angular version: 2.2.2
Browser: [all ]