无法加载ui-bootstrap

时间:2013-07-02 07:50:05

标签: twitter-bootstrap angularjs

我创建了一个简单的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文件进行任何修改。

1 个答案:

答案 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>

能解决吗?