"angularjs uib alert example!"
Bootstrap 3.3.0 Snippet by muhittinbudak

<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> <script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <!------ Include the above in your HEAD tag ----------> <!DOCTYPE html> <html ng-app="app"> <head> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js"></script> <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-animate.js"></script> <script src="//angular-ui.github.io/bootstrap/ui-bootstrap-tpls-1.3.2.js"></script> <link href="//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"> </head> <body ng-controller="Ctrl"> <h1>Alert With Animation</h1> <uib-alert class='repeat-item' ng-repeat="alert in alerts" type="{{alert.type}}" dismiss-on-timeout="2000" close="alerts.splice($index, 1);">{{alert.msg}} </uib-alert> <input type='text' ng-model='msg' /> <button ng-click="addAlert(msg,'success')">Add Alert</button> </body> </html>
.repeat-item.ng-enter, .repeat-item.ng-leave { -webkit-transition: 0.5s linear all; transition: 0.5s linear all; } .repeat-item.ng-enter, .repeat-item.ng-leave.ng-leave-active { opacity: 0; } .repeat-item.ng-leave, .repeat-item.ng-enter.ng-enter-active { opacity: 1; }
var app = angular.module('app', ['ui.bootstrap']); app.controller('Ctrl', function ($scope) { $scope.alerts = []; $scope.msg = "Animation fixed!"; $scope.addAlert = function(msg, type) { $scope.alerts.push({ msg: msg, type: type }); }; });

Related: See More


Questions / Comments: