Uib-alert css样式不适用

时间:2016-08-12 06:25:37

标签: angularjs angular-ui-bootstrap

<uib-alert  ng-repeat= "alert in ConfigurationAlerts"  close="closeAlert($index)">  {{alert.msg}} </uib-alert>

var eWiggle = angular.module('eWiggleApp',['ui.router', 'ngAnimate', 'ui.bootstrap','blockUI','ngCookies']);

1 个答案:

答案 0 :(得分:3)

从版本2.0开始,uib-alert指令已更改为属性而非元素,这意味着您需要将其附加到div。您还没有指定一个类,这决定了警报的颜色方案。您的示例应如下所示:

<div uib-alert ng-class="'alert-success'" ng-repeat="alert in ConfigurationAlerts"  close="closeAlert($index)"> {{alert.msg}} </div>

The documentation has an example which is worth looking at.