angularjs – Angular UI Bootstrap Alert Closable Issue
发布时间:2020-12-17 17:31:44 所属栏目:安全 来源:网络整理
导读:我使用 Angular UI Bootstrap生成警报框,使用以下代码: alert data-ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)"{{alert.msg}}/alert 它按预期呈现: 我的问题是:是否有某种方法可以将某些通知关闭,而其他通知则根据变
我使用
Angular UI Bootstrap生成警报框,使用以下代码:
<alert data-ng-repeat="alert in alerts" type="{{alert.type}}" close="closeAlert($index)">{{alert.msg}}</alert> 它按预期呈现: 我的问题是:是否有某种方法可以将某些通知关闭,而其他通知则根据变量? 我编写了这个模拟代码,并且只在closeable为true时才显示可关闭的x. $scope.alerts = [ { type: 'danger',closeable: false,msg: 'Oh snap! Change a few things up and try submitting again.' },{ type: 'success',closeable: true,msg: 'Well done! You successfully read this important alert message.' },{ type: 'warning',msg: 'Be careful! Something may go wrong here.' },{ type: 'info',msg: 'Attention! Here is some news for you.' } ]; 解决方法
试试你的十字架
<button type="button" class="close" data-dismiss="alert" ng-if="alert.closable"> <span aria-hidden="true">× </span><span class="sr-only">Close</span></button> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- bootstrapValidator 重新启用提交按钮的方法
- keepalived + haproxy 实现web 双主模型的高可用负载均衡--
- angularjs – 在Access-Control-Request-Headers下添加$htt
- 快速scala编译器:无法建立与编译守护程序的连接
- angularjs – 从量角器激活时激活chrome语言标志(selenium)
- angularjs – angular js浏览器后退按钮在路由时不起作用
- 【数据结构】栈-链表的实现
- [Angular] Angular i18n Alternative Expressions Support
- 解决easyui和bootstrap兼容问题
- 如果不执行其他操作,Scala和Java选项会存在