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

来源:互联网 发布:万圣节照相软件 编辑:程序博客网 时间:2024/06/05 11:57

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.  //定义控制器时传入依赖  
  9.  angular.module('myApp')  
  10.   .conroller('MenuCtrl', function ($scope,toastr) {  
  11.   //此句会有提提效果,见图1  
  12.     toastr.success("祝贺你成功了");   
  13.     });  

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



0 0
原创粉丝点击