4

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

4

1 回答 1

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>

那能解决吗?

于 2013-07-02T07:53:22.307 回答