Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OcLazyLoad have two controllers as dependency #406

Open
Deimos620 opened this issue Aug 28, 2017 · 0 comments
Open

OcLazyLoad have two controllers as dependency #406

Deimos620 opened this issue Aug 28, 2017 · 0 comments

Comments

@Deimos620
Copy link

Deimos620 commented Aug 28, 2017

I am using OcLazyLoad to load controller in router.
Here is snippet of my router.

.state("admin.report_draft", {
                url: "/report_draft",
                template: "<Redirect state='admin' page='report_draft'>",
                controller: "DraftReportController",
                resolve: {
                    deps: ['$ocLazyLoad', function ($ocLazyLoad) {
                        return $ocLazyLoad.load({
                            name: 'MetronicApp',
                            insertBefore: '#ng_load_plugins_before',
                            files: [
                                'js/controllers/EditReportModalController.js',
                                'js/controllers/DraftReportController.js',
                                '../bower_components/angular-ui-select/dist/select.css',
                                '../bower_components/angular-chips/dist/main.css'
                            ]
                        });
                    }],
                },
                data: {pageTitle: 'Draft Reports'},
            })

Inside DraftReportController, I called ModalService to display modal.

angular.module('MetronicApp').controller('DraftReportController', function($scope, $state, djangoAuth, configService, FileUploader, ModalService, EditReportModalController){
....

$scope.editDraft = function(report){
        ModalService.showModal({
            templateUrl: "views/modals/edit_report_draft.html",
            controller: "EditReportModalController",
            input:{
                report: report
            }
        }).then(function(modal){
            modal.element.modal();
        })
    };
....

Here I am getting error:

Unknown provider: EditReportModalControllerProvider <- EditReportModalController <- DraftReportController

It seems EditReportModalController can not be resolved as dependency.
Would you like to help me? How can I have EditReportModalController inside DraftReportController as dependency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant