AngularJS和凉亭问题

时间:2018-02-17 08:18:07

标签: angularjs bower

我收到了这个未被捕获的语法错误,我尝试了一些我见过但尚无解决方案的解决方案,尝试设置AngularJS来显示我的HTML页面,但是当我在浏览器中运行它时,它显示以下错误:

  

uncaught SyntaxError:意外的令牌<在控制台中的angular.js:1中。

我的 app.js



 angular.module('app', ['ngRoute']);
    angular.module('app').config([
        '$routeProvider', '$locationProvider',
        function ($routeProvider, $locationProvider) {
            $locationProvider.html5Mode(true);
            $routeProvider
                .when('/', {
                    templateUrl: '/app/home/index.html',
                    controller: 'HomeController',
                    controllerAs: 'vm'
                })
                .when('/about', {
                    templateUrl: '/app/about/index.html',
                    controller: 'AboutController',
                    controllerAs: 'vm'
                })
        }
    ])

    <!DOCTYPE html>
    <html ng-app="app">
    <head>
        <title></title>
        <link rel="stylesheet" href="/bootstrap/bootstrap.css">
        <base href="/">
    </head>
    <body>
        <div class="container" ng-controller="LabController as vm">
            <div class="alert alert-success">
                    <i class="far fa-lg fa-thumbs-o-up"></i>{{"Angular is working"}}
                </div>
                <div class="navbar">
                        <ul class="nav navbar-nav">
                            <li><a href="/">Home</a></li>
                            <li><a href="/about">About</a></li>
                        </ul>
                    </div>
                    <div ng-view></div>
        </div>
        <!-- <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script> -->
        <script src="bower_components/angular/angular.min.js"></script>
        <script src="bower_components/angular-route/angular-route.js"></script>
        <script src="app/app.js"></script></script>
        <script src="app/HomeController.js"></script>
    </body>
    </html>
&#13;
&#13;
&#13;

0 个答案:

没有答案