使用 ngRoute 时崩溃 angular

Crash when use ngRoute angular

我想用 angular 构建 SPA,但我遇到了这个问题。这是我的代码。在主页中,我使用 ng-include 导航栏 html:

   <div ng-include="'/project/app/client/shop/shop-header/shop-header.html'"></div>
 <div ng-view></div>

在我的页眉中:

<li><a data-ng-href="/" class="btn btn-default" >
       <span style="color: #C62828">Shop</span>
 </a></li>
 <li >
     <a data-ng-href="/cart" class="btn btn-default" >Cart</a>
</li>

js文件

 angular
            .module('app.shop',['ngRoute'])
            .config(configRoute);

            configRoute.$inject= ['$routeProvider'];

            function configRoute($routeProvider){
                $routeProvider
                    .when('/',{templateUrl:'shop.html'})
                    .when('/cart'{templateUrl:'/project/app/client/cart/cart.html'})
                    .otherwise({ redirectTo: '/' });        
                    }

但是当我 运行 主页时,控制台日志警告:尝试 运行 angular 239 次并崩溃。请帮助我

只要您的代码加载了多个 angular.js 文件,您就会看到该警告,只需放入一个并删除 HTML 中的所有其他 angular.js 文件,您的问题就会得到解决