{"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":[{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/labels/question","name":"question","color":"cc317c"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-08-28T15:05:00Z","updated_at":"2016-10-08T15:35:43Z","closed_at":"2015-09-11T17:23:50Z","body":"I'd like to duplicate [my question from stackoverflow][3] here too...\r\n\r\nI'm using [ocLazyLoad][1] 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\r\n\r\nFrom [this thread][2] I understand that I can load modules in series:\r\n\r\n> Yes the files are loaded in parallel, if you want to multiple modules\r\n> at the same time and that they require one another you either need to\r\n> define them in different object params:\r\n```js\r\n    $ocLazyLoad.load([{\r\n        name: 'TestModule',\r\n        files: ['testModule.js', 'testModuleCtrl.js', 'testModuleService.js']\r\n    },{\r\n        name: 'AnotherModule',\r\n        files: ['anotherModule.js']\r\n    }]);\r\n```\r\n\r\nNow I try to load all dependencies required for FullCalendar in my application, there's my ocLazyLoad config file:\r\n```js\r\n    $ocLazyLoadProvider.config({\r\n    \t\t debug: true,\r\n    \t\t modules: [{\r\n    \t\t\t    name: 'ngCkeditor',\r\n    \t\t\t    files: [\r\n    \t\t\t            \t'resources/bower_components/ng-ckeditor/libs/ckeditor/ckeditor.js',\r\n    \t\t\t            \t'resources/bower_components/ng-ckeditor/ng-ckeditor.min.js',\r\n    \t\t\t            \t'resources/bower_components/ng-ckeditor/ng-ckeditor.css'\r\n    \t\t\t            ],\r\n    \t\t\t    serie: true\r\n    \t\t },{\r\n    \t\t\t    name: 'ui.calendar',\r\n    \t\t\t    files: [\r\n    \t\t\t            'resources/bower_components/fullcalendar/dist/fullcalendar.min.js',\r\n    \t\t\t            'resources/bower_components/fullcalendar/dist/lang/he.js',\r\n    \t\t\t            'resources/bower_components/fullcalendar/dist/gcal.js',\r\n    \t\t\t            'resources/bower_components/angular-ui-calendar/src/calendar.js',\r\n    \t\t\t            'resources/bower_components/fullcalendar/dist/fullcalendar.min.css'\r\n    \t\t\t            ],\r\n    \t\t\t    serie: true\r\n    \t\t },{\r\n    \t\t\t    name: 'ngFileUpload',\r\n    \t\t\t    files: [\r\n    \t\t\t            \t'resources/bower_components/ng-file-upload/ng-file-upload.min.js'\r\n    \t\t\t            ]\r\n    \t\t },{\r\n    \t\t\t    name: 'momentjs',\r\n    \t\t\t    files: [\r\n    \t\t\t            \t'resources/bower_components/moment/min/moment.min.js'\r\n    \t\t\t            ]\r\n    \t\t }]\r\n    \t});\r\n```\r\nAnd this is part of my router:\r\n```js\r\n    .state('schedule',{\r\n    \t\t\turl: '/schedule',\r\n    \t\t\tcontroller:\t\t'ScheduleController',\r\n    \t\t\ttemplateUrl:\t'schedule.html',\r\n    \t\t\tresolve: {\r\n    \t\t          loginRequired: loginRequired,\r\n    \t\t          loadMyCtrl: ['$ocLazyLoad', function($ocLazyLoad) {\r\n    \t\t              // you can lazy load files for an existing module\r\n    \t\t                     return $ocLazyLoad.load(['momentjs','ui.calendar','ngCkeditor']);\r\n    \t\t           }]\r\n    \t\t    }\r\n    \t\t})\r\n```\r\nDespite that module `'momentjs'` defined at first place I still get an error: `Uncaught ReferenceError: moment is not defined`\r\n\r\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. \r\n\r\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?\r\n\r\nThank you in advance.\r\n\r\n\r\n  [1]: https://oclazyload.readme.io/\r\n  [2]: https://github.com/ocombe/ocLazyLoad/issues/34\r\n[3]:http://stackoverflow.com/questions/32274048/how-do-modules-in-oclazyload-loaded-parallel-or-in-sequence"},"comment":{"url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/comments/252430907","html_url":"https://github.com/ocombe/ocLazyLoad/issues/226#issuecomment-252430907","issue_url":"https://api.github.com/repos/ocombe/ocLazyLoad/issues/226","id":252430907,"user":{"login":"m98","id":7496103,"avatar_url":"https://avatars.githubusercontent.com/u/7496103?v=3","gravatar_id":"","url":"https://api.github.com/users/m98","html_url":"https://github.com/m98","followers_url":"https://api.github.com/users/m98/followers","following_url":"https://api.github.com/users/m98/following{/other_user}","gists_url":"https://api.github.com/users/m98/gists{/gist_id}","starred_url":"https://api.github.com/users/m98/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m98/subscriptions","organizations_url":"https://api.github.com/users/m98/orgs","repos_url":"https://api.github.com/users/m98/repos","events_url":"https://api.github.com/users/m98/events{/privacy}","received_events_url":"https://api.github.com/users/m98/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T15:35:43Z","updated_at":"2016-10-08T15:35:43Z","body":"I am doing it, but I don't know why do I get this error:\r\n\r\n> TypeError: Cannot read property 'shift' of undefined\r\n"}}
{"actor":{"display_login":"m98"}}