我创建了一个简单的AngularJS
页面但由于UI Bootstrap
而无法加载。 HTML代码是:
<!doctype html>
<html lang="en" ng-app="myapp">
<head>
<meta charset="utf-8">
<title>My HTML File</title>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular/angular-ui-router.js"></script>
<script src="lib/angular/ui-bootstrap-0.4.0.js"></script>
<script src="lib/angular/angular-strap.js"></script>
<script src="js/app.js"></script>
</head>
<body>
<div ui-view="headerView"></div>
<div ui-view="navigationView"></div>
<div ui-view="contentView"></div>
</body>
</html>
Chrome
中的错误是:
Uncaught SyntaxError: Unexpected token < ui-bootstrap-0.4.0.js:3
Firebug
中的错误:
SyntaxError: syntax error
[Break On This Error]
<!DOCTYPE html>
ui-boo....4.0.js (line 3
我没有对UI Bootstrap
javascript文件进行任何修改。
答案 0 :(得分:3)
您是否尝试过切换js文件的顺序?
<head>
<meta charset="utf-8">
<title>My HTML File</title>
<script src="js/app.js"></script>
<script src="lib/angular/ui-bootstrap-0.4.0.js"></script>
<script src="lib/angular/angular.js"></script>
<script src="lib/angular/angular-ui-router.js"></script>
<script src="lib/angular/angular-strap.js"></script>
</head>
能解决吗?