ocombe / ocLazyLoad

Lazy load modules & components in AngularJS
https://oclazyload.readme.io
MIT License
2.63k stars 510 forks source link

Is there any dependency manager? #246

Open Jeevanandanj opened 9 years ago

Jeevanandanj commented 9 years ago

Started to implement the ocLazyLoad, since it has easy implementation than require js.

But while I start to implement, I had a doubt. There is functionality in requirejs regarding managing dependency. In oclazyload, I don't know how to implement this.

For example,

 return $ocLazyLoad.load(['AdminTheme', 'widgets','MobileNavigation', {
                              name: 'myApp',
                              files: [
                                  'App/Dashboard/dashboardService.js',
                                  'App/Dashboard/dashboardCtrl.js'
                              ],
                              serie: true
                          }]);

But I've loaded this AdminTheme in login itself. So We don't need this until page refresh. This admintheme will be vanished from the browser when page refresh.

So I've included them when loading the Dashboard controller.

Is there any way like following require js code? 
So that would be easy to maintain the code and will increase the usability.
shim: {
    'apps':{
              deps: ['angular','coremodule']
     }
}

Note: I may missed to read out any docs. But I've searched for this and I didn't find.

ocombe commented 9 years ago

Hmm no there is nothing like this for now. It's true that sometimes it can get a little complicated to deal with routes that follow each other. But if you use ui-router and nested states it will be managed by the dependency graph (each resolve from the nested states will be called in order): https://github.com/angular-ui/ui-router/wiki/Nested-States-and-Nested-Views

Jeevanandanj commented 9 years ago

Thanks. But I didn't use nested routings :-(