Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined config #99

Closed
R1cs1KING opened this issue Nov 11, 2020 · 2 comments
Closed

Undefined config #99

R1cs1KING opened this issue Nov 11, 2020 · 2 comments

Comments

@R1cs1KING
Copy link

Hi everyone!

I have encountered an issue with the library while I was upgrading from Angular 6 to 10. The error occurs at Angular 9.1.

I am receiving the following issue on Chrome: TypeError: Cannot read property 'toast' of undefined and on Firefox: TypeError: this.config is undefined. The dependency injection is done as it is written in the documentation, but when I check the variable it has an undefined config.

I am using v9.0.1 of the library.

Thank your for the help in advance! :)

@R1cs1KING
Copy link
Author

I have found a solution, I had to change the part with the dependency injection, so instead of
constructor(private snotifyService: SnotifyService) {}
it looks like
constructor(private snotifyService: SnotifyService) {snotify.config = ToastDefaults;}

ToastDefaults of course was imported form ng-snotify

@popovgeorgi
Copy link

I have found a solution, I had to change the part with the dependency injection, so instead of
constructor(private snotifyService: SnotifyService) {}
it looks like
constructor(private snotifyService: SnotifyService) {snotify.config = ToastDefaults;}

ToastDefaults of course was imported form ng-snotify

Thank you, it resolves the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants