search

Home  >  Q&A  >  body text

angular.js - angularjs的ocLazyLoad问题

在angularjs项目中使用ui-router+ocLazyLoad实现按需加载时,自己写了个demo是可以实现的。放到项目中var App = angular.module('app', ['ui.router','oc.lazyLoad'])这样写会报错,如下所示,ocLazyLoad.js确认是加载了这是什么原因?

这是代码`

angular.module('app', ['ui.router','oc.lazyLoad'])
  .config(function ($stateProvider,$locationProvider, $urlRouterProvider,$ocLazyLoadProvider) {

    $stateProvider
      .state('dataQuery.areaMany', {
        url: '/areaMany',
          views: {
            'lazyLoadView': {
              templateUrl: 'app/main/dataQuery/areaMany.html'
            }
          },
          resolve: {
            loadMyCtrl: ['ocLazyLoad',function($ocLazyLoad){
              return $ocLazyLoad.load([
                  'app/main/dataQuery/areaMany.js'
              ])
            }]
          }
      })
  });

`感觉根报的错误没关系啊

迷茫迷茫2744 days ago838

reply all(3)I'll reply

  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-15 17:10:16

    The problem reported is about $cookieStore. Can you complete the code? I can’t see the problem

    reply
    0
  • 某草草

    某草草2017-05-15 17:10:16

    $cookieStore is referenced in a certain js, but it is not injected

    reply
    0
  • 習慣沉默

    習慣沉默2017-05-15 17:10:16

    angular version problem

    reply
    0
  • Cancelreply