Getting 'Cannot read property 'then' of undefined' using toastr

783 Views Asked by At

I issued toastr.error("a message") but got this error. It happens in _setContainer when it does $animate.enter().then(function()). What am I missing?

function _setContainer(options) {
  if(container) { return containerDefer.promise; } // If the container is there, don't create it.

  container = angular.element('<div></div>');
  container.attr('id', options.containerId);
  container.addClass(options.positionClass);
  container.css({'pointer-events': 'auto'});
  var body = $document.find('body').eq(0);
  $animate.enter(container, body).then(function() {
    containerDefer.resolve();
  });
  return containerDefer.promise;
}
1

There are 1 best solutions below

0
On

The version of angular-toastr that is supported with [email protected] is 0.3.0