<link href="https://cdnjs.cloudflare.com/ajax/libs/angularjs-toaster/0.4.16/toaster.min.css" rel="stylesheet" /> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js" ></script> <script src="https://code.angularjs.org/1.2.0/angular-animate.min.js" ></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/angularjs-toaster/0.4.16/toaster.min.js"></script>
<toaster-container></toaster-container>
angular.module('main', ['toaster', 'ngAnimate'])
.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>
<toaster-container toaster-options="{'close-button': true}"></toaster-container>
<toaster-container toaster-options="{'close-button':{ 'toast-warning': true, 'toast-error': false } }"></toaster-container>
toaster.pop({
type: 'error',
title: 'Title text',
body: 'Body text',
showCloseButton: true
});
<toaster-container toaster-options="{'close-html':'<button>Close</button>', 'showCloseButton':true}"></toaster-container>
toaster.pop({
type: 'error',
title: 'Title text',
body: 'Body text',
showCloseButton: true,
closeHtml: '<button>Close</button>'
});
$scope.pop = function(){
toaster.pop({
type: 'error',
title: 'Title text',
body: 'cont.html',
showCloseButton: true,
bodyOutputType:'template',
closeHtml: '<span>wqeqwe</span>'
});
};
toaster.pop({
type: 'info',
body: 'bind-unsafe-html',
bodyOutputType: 'directive'
});
.directive('bindUnsafeHtml', [function () {
return {
template: "<span style='color:orange'>Orange directive text!</span>"
};
}])
toaster.pop({
type: 'info',
body: 'bind-name',
bodyOutputType: 'directive',
directiveData: { name: 'Bob' }
});
.directive('bindName', [function () {
return {
template: "<span style='color:orange'>Hi {{directiveData.name}}!</span>"
};
}])
<toaster-container toaster-options="{'body-output-type': 'template'}"></toaster-container>
toaster.pop({
title: 'A toast',
body: 'with a callback',
onHideCallback: function () {
toaster.pop({
title: 'A toast',
body: 'invoked as a callback'
});
}
});
<toaster-container toaster-options="{'position-class': 'toast-top-full-width'}"></toaster-container>
<toaster-container toaster-options="{'position-class': 'toast-top-center', 'close-button':true}"></toaster-container>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有