jquery – Toastr未定义在angularjs

我正在做教程,这部分是关于实现登录,这应该给予关于登录成功的资料库
angular.module("app").value("mvToastr",toastr);

angular.module("app").factory("mvNotifier",function(mvToastr) {
   return {
      notify: function(msg) {
          mvToastr.success(msg);
          console.log(msg);
       }
    }
});

我得到这个,我不明白一点.所有.js文件似乎都被加载.请告诉我问题在哪里,谢谢.

TypeError: Cannot call method 'extend' of undefined
   at getoptions (http://localhost:3030/vendor/toastr/toastr.js:282:14)
   at Object.success (http://localhost:3030/vendor/toastr/toastr.js:68:17)
   at Object.notify (http://localhost:3030/app/common/mvNotifier.js:6:22)
   at http://localhost:3030/app/account/mvNavBarLoginCtrl.js:8:28
   at wrappedCallback (http://localhost:3030/vendor/angular/angular.js:11033:81)
   at wrappedCallback (http://localhost:3030/vendor/angular/angular.js:11033:81)
   at http://localhost:3030/vendor/angular/angular.js:11119:26
   at Scope.$eval (http://localhost:3030/vendor/angular/angular.js:12045:28)
   at Scope.$digest (http://localhost:3030/vendor/angular/angular.js:11871:31)
   at Scope.$apply (http://localhost:3030/vendor/angular/angular.js:12151:24)

   angular.js:9503

解决方法

看看 toastr sources它看起来像getoptions()调用jQuery的$.extend()方法.

Toastr依赖于jQuery,从github自述文件的第一行:

toastr is a Javascript library for non-blocking notifications. jQuery
is required
. The goal is to create a simple core library that can be
customized and extended.

只需在你的主视图html中包含jquery.

<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>

相关文章

页面搜索关键词突出 // 页面搜索关键词突出 $(function () {...
jQuery实时显示日期、时间 html: &lt;span id=&quot...
jQuery 添加水印 &lt;script src=&quot;../../../.....
中文:Sys.WebForms.PageRequestManagerParserErrorExceptio...
1. 用Response.Write方法 代码如下: Response.Write(&q...
Jquery实现按钮点击遮罩加载,处理完后恢复 思路: 1.点击按...