$喷油器:modulerr当我使用角带? [英] $injector:modulerr when i use angular-strap?
问题描述
我会告诉我的所有code:
i'll show all my code:
<!doctype html>
<html lang="en" ng-app='myapp'>
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="bootstrap/css/bootstrap.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap-responsive.css">
</head>
<body ng-controller="myCtrl">
<input type="text" ng-model="testforie">
<h1>{{testforie}}</h1>
<button type="button" class="btn btn-lg btn-primary" data-placement="top-right" data-container="body" data-duration="3" bs-alert="alert">Click to toggle alert
<br>
<small>(using an object)</small>
</button>
<div>
<button data-template="popoverTpl.html" bs-popover>angular strap popover</button>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-route.min.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.min.js"></script>
<script src="bower_components/angular-strap/dist/angular-strap.tpl.min.js"></script>
<script src="app.js"></script>
</body>
</html>
我的控制器:
angular.module('myapp',['ngAnimate', 'ngSanitize', 'mgcrea.ngStrap'])
.controller('myCtrl', ['$scope','$alert', function ($scope,$alert) {
$scope.alert = {
"title": "Holy guacamole!",
"content": "Best check yo self, you're not looking too good.",
"type": "info"
};
var myAlert = $alert({title: 'Holy guacamole!', content: 'Best check yo self, you\'re not looking too good.', placement: 'top', type: 'info', show: true});
}])
该错误是:
未捕获的错误:[$喷油器:modulerr]
的http://errors.angularjs.org/1.2.9/$injector/modulerr?p0=myapp&p1=Error%3A%2…org%2F1.2.9%2F%24injector%2Fmodulerr%3Fp0%3DngAnimate%26p1%3DError%253A%25......5)
Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.2.9/$injector/modulerr?p0=myapp&p1=Error%3A%2…org%2F1.2.9%2F%24injector%2Fmodulerr%3Fp0%3DngAnimate%26p1%3DError%253A%25......5)
这是一个非常简单的演示,我只是想开始用角带,但总是有一些错误显示表明我错过了一些文件,这真的吓坏我了!
this is a very easy demo, i just want to start use angular strap, but there always some errors show up indicate my miss some files, this really freak me out!
哪里是我的问题吗?我怎么能开始我的角带的应用程序?
Where is my problem? How could i start my angular strap app?
推荐答案
您已经定义 ngSanitize
作为一个依赖你的的myapp </ code>模块,但不包括 angular- sanitize.min.js 在HTML
You've defined ngSanitize
as a dependency in your myapp
module, but not included angular-sanitize.min.js in the HTML.
添加&LT;脚本src=\"http://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular-sanitize.min.js\"></script>$c$c>你应该罚款:)
这篇关于$喷油器:modulerr当我使用角带?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!