Sydney
Sydney

Reputation: 12212

Can't load ui-bootstrap

I created a simple AngularJS page but it fails to load because of UI Bootstrap. The HTML code is:

<!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>

The error in Chrome is:

Uncaught SyntaxError: Unexpected token < ui-bootstrap-0.4.0.js:3

The error in Firebug:

SyntaxError: syntax error
[Break On This Error]   

<!DOCTYPE html>

ui-boo....4.0.js (line 3

I did no modification on UI Bootstrap javascript file.

Upvotes: 4

Views: 6754

Answers (1)

Kees Sonnema
Kees Sonnema

Reputation: 5784

Have you tried switching the order of your js files like so?

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

Could that fix it?

Upvotes: 3

Related Questions