简体   繁体   English

使用toastr获取“无法读取未定义的属性'then'”

[英]Getting 'Cannot read property 'then' of undefined' using toastr

I issued toastr.error("a message") but got this error. 我发出了toastr.error("a message")但收到此错误。 It happens in _setContainer when it does $animate.enter().then(function()) . 它在_setContainer执行$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;
}

angular@1.2支持的angular-toastr版本是0.3.0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 (Angular2) 无法读取 toastr 的未定义属性“扩展” - (Angular2) Cannot read property 'extend' of undefined for toastr Nebular Toastr &gt; 无法读取 null 的属性“appendChild” - Nebular Toastr > Cannot read property 'appendChild' of null 使用Promise,得到错误“无法读取未定义的属性&#39;then&#39;” - Using Promise, getting error “Cannot read property 'then' of undefined” 返回一个Promise,但是得到“无法读取未定义的属性&#39;then&#39;” - Returning a Promise, but getting 'Cannot read property 'then' of undefined' 获取错误无法读取未定义的属性“等于” - Getting Error Cannot read property 'equals' of undefined 无法读取属性“#” <Object> 的不确定错误? - Cannot read property '#<Object>' of undefined getting error? ×获取TypeError:无法读取未定义的属性“ map” - × Getting a TypeError: Cannot read property 'map' of undefined 获取错误&#39;无法读取属性&#39;getAttribute&#39;of undefined&#39; - Getting error 'Cannot read property 'getAttribute' of undefined' 收到“无法读取未定义的属性”错误 - Getting a "Cannot read property of undefined" error 获取错误无法读取未定义的属性“ getTime” - Getting error Cannot read property 'getTime' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM