angularJS应用程序上的无限循环

时间:2015-06-17 23:00:52

标签: javascript jquery angularjs

我有以下config.js代码

function config($stateProvider, $urlRouterProvider, $ocLazyLoadProvider, IdleProvider, KeepaliveProvider) {

    // Configure Idle settings
    IdleProvider.idle(5); // in seconds
    IdleProvider.timeout(120); // in seconds

    $urlRouterProvider.otherwise("/dashboards/dashboard_1");

    $ocLazyLoadProvider.config({
        // Set to true if you want to see what and when is dynamically loaded
        debug: true
    });

    $stateProvider

        .state('dashboards', {
            abstract: true,
            url: "/dashboards",
            templateUrl: "viewsangular/common/content.html",
        })
        .state('dashboards.dashboard_1', {
            url: "/dashboard_1",
            templateUrl: "viewsangular/dashboard_1.html",
            resolve: {
                loadPlugin: function ($ocLazyLoad) {
                    return $ocLazyLoad.load([
                        {
                            serie: true,
                            name: 'angular-flot',
                            files: ['Scripts/plugins/flot/jquery.flot.js', 'Scripts/plugins/flot/jquery.flot.time.js', 'Scripts/plugins/flot/jquery.flot.tooltip.min.js', 'Scripts/plugins/flot/jquery.flot.spline.js', 'Scripts/plugins/flot/jquery.flot.resize.js', 'Scripts/plugins/flot/jquery.flot.pie.js', 'Scripts/plugins/flot/curvedLines.js', 'Scripts/plugins/flot/angular-flot.js', ]
                        },
                        {
                            name: 'angles',
                            files: ['Scripts/plugins/chartJs/angles.js', 'Scripts/plugins/chartJs/Chart.min.js']
                        },
                        {
                            name: 'angular-peity',
                            files: ['Scripts/plugins/peity/jquery.peity.min.js', 'Scripts/plugins/peity/angular-peity.js']
                        }
                    ]);
                }
            }
  });
}
angular
    .module('inspinia')
    .config(config)
    .run(function($rootScope, $state) {
        $rootScope.$state = $state;
    });

我知道视图的链接是正确的。

但是我收到以下错误 http://screencast.com/t/9dNPbBKl10aL

并且页面处于无限循环中 https://localhost/viewsangular/index.html#

https://localhost/viewsangular/index.html#/Dashboards/Dashboard1

视图文件在那里。 http://screencast.com/t/QbPHcN6Voxh

1 个答案:

答案 0 :(得分:2)

从这里vertex_iterator

它说它无法实例化模块inspinia。所以一定要注入模块。或检查其他内容是否干扰了您的代码。

访问该链接 The Angular Module error