Angular controller not loading using OcLazyLoad and ngRoute

后端 未结 1 902
逝去的感伤
逝去的感伤 2021-01-14 04:14

I have an app that which has a load of scripts loading initially and the list is growing as development goes on. I want to lazy load scripts which contain controllers as and

相关标签:
1条回答
  • 2021-01-14 04:48

    In your separate case-review.js, you must get the reference of app.

    angular.module('dashboard').controller('caseReviewController', function($scope, localStorageService, $route){
        //do stuff
    });
    

    As you've mentioned it's in separate file, it may not know about the app variable. It's better to get the reference of the angular module in the separate file.

    This must solve your issue.

    0 讨论(0)
提交回复
热议问题