Questions tagged [ngx-toastr]
46 questions
12
votes
4 answers
NullInjectorError: StaticInjectorError(DynamicTestModule)[ToastrService -> InjectionToken ToastConfig]: in tslint angular 8
When i run the unit testing in angular 8 project, i found an error in ngx-toastr
NullInjectorError: StaticInjectorError(DynamicTestModule)[ToastrService -> InjectionToken ToastConfig]:
And i imported the requierd modules in the spec.ts file, And…

tamilselvan s
- 1,045
- 2
- 11
- 13
4
votes
2 answers
ngx-toastr - Generic type 'ɵɵComponentDeclaration' requires between 7 and 8 type arguments
I have installed ngx-toastr and imported in app.module.ts but getting this error while compiling
enter image description here...is it because i have set the properties of toaster in service file which I created like below?enter image description…

KiG
- 41
- 1
- 3
4
votes
1 answer
ngx-toastr.js?4996:264 Uncaught TypeError: Object(...) is not a function at eval (ngx-toastr.js?4996:264)
I am using ngx-toastr in angular 6 for http error notification, as injected ToastrService in httpInterceptor
export class MyInterceptor implements HttpInterceptor {
constructor(public toasterService: ToastrService) { }
…

user2515612
- 41
- 2
3
votes
3 answers
Customise Ngx-toastr in angular 6 with typescript
Hii All i am implementing Ngx-toastr in angular 6 with typescript my problem is that i can't make it beautiful as i want because i dont't know which css is override on that ngx-toastr class i wrote some css on Style.css File ngx-toastr and i want…

Kiran Mistry
- 2,614
- 3
- 12
- 28
2
votes
0 answers
When accessing another component's function in Angular, this keyword is not working
export class ComponeComponent implements OnInit {
constructor(private cService: CService, private toastr: ToastrService) { }
//class variable so that I can assign perticular client object
clientObj: any;
//to get all the client
clients:…

Laharee
- 21
- 3
2
votes
3 answers
Angular JS ngx-toastr Error: Module not found: Error: Package path ./public_api is not exported from package
./src/app/nav/nav.component.ts:5:0-44 - Error: Module not found: Error: Package path ./public_api is not exported from package C:\Users\Score\demo\DatingApp\client\node_modules\ngx-toastr (see exports field in…

Monirul Islam
- 178
- 1
- 9
2
votes
1 answer
Ngx-toastr - Set global config for specific toast
Is there any way to set global settings for individual toast config?
I want to set this config only to error toast:
{
timeOut: 0,
extendedTimeOut: 0,
closeButton: true
}
I know that I can pass those settings to individual toast…

Dual
- 23
- 4
2
votes
1 answer
How to pass data object to ngx-toastr template?
I'm trying to create a custom template for ngx-toastr - so i've followed this example below, (Example) what i can't figure out is how can i pass an object in the Message area - so the implementation will be like:
const DATA = {name:"Ron",…

RoyBarOn
- 919
- 3
- 24
- 63
2
votes
1 answer
NullInjectorError: No provider for Overlay! NgxToastr
I have been scratching my head for last one day on this. I am using Ngx-Toastr package in my angular application. Below are the points which I think help you understand the problem.
In dev server (ng serve) I didn't get any error there was no…

Souradip
- 111
- 1
- 10
2
votes
1 answer
ngx-toastr: How to get current toast Id inside the custom toast component
On click of a button inside a toast I want to close that particular toast.
I want to know a way to get the toast Id inside the custom toast component
Below is my code
action(btn: IToastButton) {
enter code hereevent.stopPropagation();
…

sairaj naik
- 23
- 3
2
votes
2 answers
How to hide ngx-toaster programmatically?
I use ngx-toaster with disableTimeOut true. So it won't hide automatically. But now I won't to hide it programmatically, when user leaving the page(inside the ngOnDestroy method). How can I do it?
this.toastr.error(message, status, {disableTimeOut:…

Sameera K
- 1,298
- 1
- 17
- 26
2
votes
4 answers
Module not found in ngx-toastr
I am not able to find the answer..
ERROR in ./node_modules/ngx-toastr/fesm5/ngx-toastr.js
Module not found: Error: Can't resolve '/Users/vasanthan/Mean projects/node_modules/@angular/animations' in '/Users/vasanthan/Mean…

Vasanth Rk
- 31
- 1
- 1
- 3
1
vote
2 answers
TypeError: Cannot create property 'message' on string Toastr error using Angular
I am using some open source code that is a couple of years old to create a blog. The Source code was created using with Angular v 11 and an earlier version of Toastr to create error messages. I have Angular v 13 on my machine but haven't had any…

Ben Crowe
- 31
- 1
- 1
- 7
1
vote
0 answers
ToastrService sometimes throw cannot read properties of undefined (reading 'toastId')
as described in the title. I have a strange problem with toastrservice from ngx-toastr library.
In only one of my modals sometimes it throws an error
cannot read properties of undefined (reading 'toastId')
the function that cause this is
public…

mario
- 186
- 3
- 16
1
vote
1 answer
ngx-toaster message is taking time to display in browser 30-40 seconds in angular 11
In App.module:
import ToastrModule in appModule
ToastrModule.forRoot({
timeOut: 3000,
preventDuplicates: true,
}),
In inner component
this.toastr.error("test err");
it is taking time to display, arount 30 to 40 sec.

Dhara Tank
- 11
- 2