{"action":"created","issue":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/226","repository_url":"https://api.github.com/repos/ocombe/ocLazyLoad","labels_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/226/comments","events_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/226/events","html_url":"https://github.com/ocombe/ocLazyLoad/issues/226","id":103735179,"number":226,"title":"How do modules in ocLazyLoad loaded, parallel or in sequence?","user":{"login":"anatoly314","id":1641594,"avatar_url":"https://avatars.githubusercontent.com/u/1641594?v=3","gravatar_id":"","url":"https://api.github.com/users/anatoly314","html_url":"https://github.com/anatoly314","followers_url":"https://api.github.com/users/anatoly314/followers","following_url":"https://api.github.com/users/anatoly314/following{/other_user}","gists_url":"https://api.github.com/users/anatoly314/gists{/gist_id}","starred_url":"https://api.github.com/users/anatoly314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anatoly314/subscriptions","organizations_url":"https://api.github.com/users/anatoly314/orgs","repos_url":"https://api.github.com/users/anatoly314/repos","events_url":"https://api.github.com/users/anatoly314/events{/privacy}","received_events_url":"https://api.github.com/users/anatoly314/received_events","type":"User","site_admin":false},"labels":[{"id":72488996,"url":"https://api.github.com/repos/ocombe/ocLazyLoad/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-08-28T15:05:00Z","updated_at":"2017-01-30T07:42:53Z","closed_at":"2015-09-11T17:23:50Z","body":"I'd like to duplicate [my question from stackoverflow](http://stackoverflow.com/questions/32274048/how-do-modules-in-oclazyload-loaded-parallel-or-in-sequence) here too...\n\nI'm using [ocLazyLoad](https://oclazyload.readme.io/) library to achieve lazy loading for all dependencies in my project. I know that by default files are loaded in parallel and to make it loaded in sequence I should use `serie:true` https://github.com/ocombe/ocLazyLoad/issues/47\n\nFrom [this thread](https://github.com/ocombe/ocLazyLoad/issues/34) I understand that I can load modules in series:\n\n> Yes the files are loaded in parallel, if you want to multiple modules\n> at the same time and that they require one another you either need to\n> define them in different object params:\n> \n> ``` js\n>     $ocLazyLoad.load([{\n>         name: 'TestModule',\n>         files: ['testModule.js', 'testModuleCtrl.js', 'testModuleService.js']\n>     },{\n>         name: 'AnotherModule',\n>         files: ['anotherModule.js']\n>     }]);\n> ```\n\nNow I try to load all dependencies required for FullCalendar in my application, there's my ocLazyLoad config file:\n\n``` js\n    $ocLazyLoadProvider.config({\n             debug: true,\n             modules: [{\n                    name: 'ngCkeditor',\n                    files: [\n                                'resources/bower_components/ng-ckeditor/libs/ckeditor/ckeditor.js',\n                                'resources/bower_components/ng-ckeditor/ng-ckeditor.min.js',\n                                'resources/bower_components/ng-ckeditor/ng-ckeditor.css'\n                            ],\n                    serie: true\n             },{\n                    name: 'ui.calendar',\n                    files: [\n                            'resources/bower_components/fullcalendar/dist/fullcalendar.min.js',\n                            'resources/bower_components/fullcalendar/dist/lang/he.js',\n                            'resources/bower_components/fullcalendar/dist/gcal.js',\n                            'resources/bower_components/angular-ui-calendar/src/calendar.js',\n                            'resources/bower_components/fullcalendar/dist/fullcalendar.min.css'\n                            ],\n                    serie: true\n             },{\n                    name: 'ngFileUpload',\n                    files: [\n                                'resources/bower_components/ng-file-upload/ng-file-upload.min.js'\n                            ]\n             },{\n                    name: 'momentjs',\n                    files: [\n                                'resources/bower_components/moment/min/moment.min.js'\n                            ]\n             }]\n        });\n```\n\nAnd this is part of my router:\n\n``` js\n    .state('schedule',{\n                url: '/schedule',\n                controller:     'ScheduleController',\n                templateUrl:    'schedule.html',\n                resolve: {\n                      loginRequired: loginRequired,\n                      loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) {\n                          // you can lazy load files for an existing module\n                                 return $ocLazyLoad.load(['momentjs','ui.calendar','ngCkeditor']);\n                       }]\n                }\n            })\n```\n\nDespite that module `'momentjs'` defined at first place I still get an error: `Uncaught ReferenceError: moment is not defined`\n\nIf I put `moment.js` in `'ui.calendar'` module it works, but I'd like to load it separately because I have another views in my application where I use only moment.js and doesn't need all dependencies. \n\nSo, my question is, how to make moduls (not files) to be loaded in a serie, not files or if they already loaded in a serie, what can cause to my mistake?\n\nThank you in advance.\n"},"comment":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/comments/275997244","html_url":"https://github.com/ocombe/ocLazyLoad/issues/226#issuecomment-275997244","issue_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/226","id":275997244,"user":{"login":"offwork","id":10039583,"avatar_url":"https://avatars.githubusercontent.com/u/10039583?v=3","gravatar_id":"","url":"https://api.github.com/users/offwork","html_url":"https://github.com/offwork","followers_url":"https://api.github.com/users/offwork/followers","following_url":"https://api.github.com/users/offwork/following{/other_user}","gists_url":"https://api.github.com/users/offwork/gists{/gist_id}","starred_url":"https://api.github.com/users/offwork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/offwork/subscriptions","organizations_url":"https://api.github.com/users/offwork/orgs","repos_url":"https://api.github.com/users/offwork/repos","events_url":"https://api.github.com/users/offwork/events{/privacy}","received_events_url":"https://api.github.com/users/offwork/received_events","type":"User","site_admin":false},"created_at":"2017-01-30T07:42:53Z","updated_at":"2017-01-30T07:42:53Z","body":"I don't understand why I can't install the dependencies mentioned in the related files in place?\r\n\r\n`(function() {\r\n    \"use strict\";\r\n\r\n    angular\r\n        .module('app.core', [\r\n        'blocks.exception',\r\n            {\r\n                files: [\r\n                    '/app/blocks/exception/exception.module.js',\r\n                    '/app/blocks/exception/exception.js',\r\n                    '/app/blocks/exception/exception-handler.provider.js'\r\n                ],\r\n                cache: false\r\n            },\r\n        'blocks.logger',\r\n            {\r\n                files: [\r\n                    '/app/blocks/logger/logger.module.js',\r\n                    '/app/blocks/logger/logger.js'\r\n                ],\r\n                cache: false\r\n            },\r\n        'blocks.router',\r\n            {\r\n                files: [\r\n                    '/app/blocks/router/router.module.js',\r\n                    '/app/blocks/router/router-helper.provider.js'\r\n                ],\r\n                cache: false\r\n            },\r\n        'ngSanitize',\r\n        'ngMaterial',\r\n        'md.data.table',\r\n        'ngMask',\r\n        'ui.router',\r\n        'oc.lazyLoad']);\r\n})();`"}}
{"actor":{"display_login":"offwork"}}