码迷,mamicode.com
首页 > Web开发 > 详细

AngularJS Toaster

时间:2016-06-14 17:31:20      阅读:285      评论:0      收藏:0      [点我收藏+]

标签:

AngularJS Toaster 是 AngularJS 的扩展,实现了无堵塞消息通知。该项目对 Toastr 进行改造,原来的 Toastr 只支持 jQuery,而 AngularJS Toaster 只需要依赖 AngularJS 即可。

// Display an info toast with no title
angular.module(‘main‘, [‘toaster‘])
.controller(‘myController‘, function($scope, toaster) {
    $scope.pop = function(){
        toaster.pop(‘success‘, "title", "text");
    };
});
<div ng-controller="myController">
    <button ng-click="pop()">Show a Toaster</button>
</div>

 html的页面中添加

<toaster-container
        toaster-options="{‘position-class‘: ‘toast-top-right‘, ‘close-button‘:true,‘body-output-type‘:‘trustedHtml‘}"></toaster-container>

  

AngularJS Toaster

标签:

原文地址:http://www.cnblogs.com/coding4/p/5584651.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!