Piotr Zakrzewski
Piotr Zakrzewski

Reputation: 3891

Toastr throws TypeError for toastr.info('msg')

I am trying out toastr but I keep getting a strange TypeError that does not make any sense to me.

TypeError: Cannot read property 'extend' of undefined
at getOptions (http://localhost:3000/bower_components/toastr/toastr.js:391:25)

I had my project scaffolded with yeoman gulp-angular and properly injected toastr into controller where I want to test it. Line I tried is simply:

toastr.info('A message.');

toastr is present in the page - inserted by a gulp task. How to find out what went wrong here?

Upvotes: 0

Views: 4292

Answers (1)

Sachin
Sachin

Reputation: 978

jQuery library might not be included. toastr getOptions method is trying to extend the config that was passed in when you initialized toastr.

Upvotes: 4

Related Questions