search

Home  >  Q&A  >  body text

angular.js - ocLazyLoad issue with angularjs

When using ui-router ocLazyLoad to implement on-demand loading in an angularjs project, it is possible to write a demo yourself. Put it in the project var App = angular.module('app', ['ui.router','oc.lazyLoad']) If you write it like this, an error will be reported, as shown below. ocLazyLoad.js Confirm that it is loaded. What is the reason?

This is the code`

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'
              ])
            }]
          }
      })
  });

`I feel like the mistake in root report is okay

迷茫迷茫2809 days ago879

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