Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/416.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angularJS应用程序上的无限循环_Javascript_Jquery_Angularjs - Fatal编程技术网

Javascript angularJS应用程序上的无限循环

Javascript angularJS应用程序上的无限循环,javascript,jquery,angularjs,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 $ur

我有下面的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://errors.angularjs.org/1.4.1/$injector/modulerr?p0=inspinia&p1=%5B%24injector%3Amodulerr%5D%20http%3A%2F%2ferrs.angularjs.org%2F1.4.1%2F%24injector%2Fmodulerr%3Fp0%3Doc.lazyLoad

它说它无法实例化inspinia模块。因此,确保注入模块。或者检查其他东西没有干扰您的代码

访问链接

哈哈,这太棒了。当你取出懒惰的加载器时会发生什么?怎么做?注释所有解析代码块?我有大约100个出于调试的目的,我建议只需要逐个取出一个状态就可以开始隔离问题。如果您只在一个状态下尝试该问题,并且与使用所有状态时相同,那么您可以开始处理仅在一个状态下隔离的问题,并希望它能解决所有问题。由于我没有更多问题,我必须为我的新问题重新编辑此问题,我解决了上一个问题,请检查我的新更新因为我没有更多的问题,我必须为我的新问题重新编辑这个问题,我解决了最后一个问题,请检查我的新更新根据文档,这是他们做的$ocLazyLoadProvider.config{modules:[{name:'TestModule',files:['js/TestModule.js']};和$stateProvider.state'index',{url:/,resolve:{loadMyService:['$ocLazyLoad',function$ocLazyLoad{return$ocLazyLoad.load'js/ServiceTest.js';}]对于他们的ui路由器,尝试从数组中删除它们并逐个测试,当然也就是删除密钥pairsname、serie和文件