这是我的 html 和 angular js 代码
<html ng-app="myApp">
<head>
<title>Angular App</title>
<link href="Styles/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="Scripts/angular.min.js" type="text/javascript"></script>
<script src="Scripts/ui-bootstrap-custom-0.4.0.js" type="text/javascript"></script>
<script src="Scripts/ui-bootstrap-custom-tpls-0.4.0.js" type="text/javascript"></script>
<script type="text/javascript" language="javascript">
var myApp = angular.module('myApp', ['ui.bootstrap.alert']);
function AlertDemoCtrl($scope) {
$scope.alerts = [
{ type: 'error', msg: 'Oh snap! Change a few things up and try submitting again.' },
{ type: 'success', msg: 'Well done! You successfully read this important alert message.' }
];
$scope.addAlert = function () {
$scope.alerts.push({ msg: "Another alert!" });
};
$scope.closeAlert = function (index) {
$scope.alerts.splice(index, 1);
};
}
</script>
</head>
<body>
<div ng-controller="AlertDemoCtrl">
<alert ng-repeat="alert in alerts" type="alert.type" close="closeAlert($index)">{{alert.msg}}</alert>
<button class='btn' ng-click="addAlert()">
Add Alert</button>
</div>
</body>
</html>
角度 UI 引导警报不起作用,并且在控制台中抛出错误
Uncaught Error: No module: ui.bootstrap.alert in angular.min.js line 17