angular定制组件-toastr(消息提醒)

前端之家收集整理的这篇文章主要介绍了angular定制组件-toastr(消息提醒)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

toastr是一个消息提醒工具。

需要的文件

angular-toastr.js

angular-toastr.css

angular把toastr封装成一个module,使用更方便。

用法

[html] view plain copy
  1. //定义模块时引入依赖
  2. angular
  3. .module('myApp',[
  4. 'ui.bootstrap',
  5. 'toastr'
  6. ]);
  7. //定义控制器时传入依赖
  8. angular.module('myApp')
  9. .conroller('MenuCtrl',function($scope,toastr){
  10. //此句会有提提效果,见图1
  11. toastr.success("祝贺你成功了");
  12. });

图1 toastr成功消息
提醒框在网页的右上角,浮动定位,所以即便你的滚动条滚到了下边也能看到。
见网址:
http://blog.csdn.net/chuchus/article/details/48153277
原文链接:https://www.f2er.com/angularjs/147352.html

猜你在找的Angularjs相关文章