Ask a Question
Back to All

I am getting "Argument 'XXXController' is not a function, got undefined" error


I want to use oclazyload in my project. I am using ui-router also.

In debug mode, I see the message

"ocLazyLoad.fileLoaded js/controllers/XXXController.js"

but after that, I am getting error.

Configuration is like below:

.state('shops.menus.entities', {
url: "/:menuid/entities",
views: {
'[email protected]': {
templateUrl: "views/wizard.html",
controller: "WizardController"

        data: {
            pageTitle: 'Menu Wizard',
            roles: ['user']

        resolve: { // Any property in resolve should return a promise and is executed before the view is loaded
            loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) {
                return $ocLazyLoad.load([
        menuTreeObject: function($stateParams, EntityService, ShopService) {
            return EntityService.getMenuTree($stateParams.menuid, function() {

            }, function() {



Thank you.