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

Can't use within app config #429

Open
iKonstX opened this issue Oct 2, 2018 · 1 comment
Open

Can't use within app config #429

iKonstX opened this issue Oct 2, 2018 · 1 comment

Comments

@iKonstX
Copy link

iKonstX commented Oct 2, 2018

Hey,

I'm having the problem that ocLazyLoad doesn't work within the app config (where all my routing stuff is located). It does work in controllers but I need it in the config to make js files load on demand.

routing.js
app.config(['$routeProvider', "$locationProvider",'$translateProvider', '$ocLazyLoadProvider', function($routeProvider, $locationProvider, $translateProvider, $ocLazyLoadProvider)

index.html
<script type="text/javascript" src="assets/js/ocLazyLoad.js?v=1"></script>

application.js
var app = angular.module("arazpvp", [ 'ngRoute', 'ngStorage', 'angular-encryption', 'ui.tinymce', 'smoothScroll', 'ngCookies', 'pascalprecht.translate', 'oc.lazyLoad']);

When adding:
routing.js
$ocLazyLoad.load({files: ['forum/community-forum.controller.js']});

I get the following error:

Failed to instantiate module arazpvp due to:
ReferenceError: $ocLazyLoad is not defined
    at https://araz4story.com/pvp/app/bin/routing.js?v=187:5:2
    at Object.invoke (https://araz4story.com/pvp/assets/js/angular.js?v=4:155:70)
    at d (https://araz4story.com/pvp/assets/js/angular.js?v=4:148:171)
    at https://araz4story.com/pvp/assets/js/angular.js?v=4:149:125
    at p (https://araz4story.com/pvp/assets/js/angular.js?v=4:8:184)
    at g (https://araz4story.com/pvp/assets/js/angular.js?v=4:148:72)
    at eb (https://araz4story.com/pvp/assets/js/angular.js?v=4:156:654)
    at c (https://araz4story.com/pvp/assets/js/angular.js?v=4:79:175)
    at Pc (https://araz4story.com/pvp/assets/js/angular.js?v=4:79:488)
    at ue (https://araz4story.com/pvp/assets/js/angular.js?v=4:77:283
@iKonstX
Copy link
Author

iKonstX commented Oct 3, 2018

Can be closed

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