ocombe / ocLazyLoad

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

Requirejs + LazyLoad #248

Open Jeevanandanj opened 8 years ago

Jeevanandanj commented 8 years ago

Hi Finally I integrate the requirejs. But understanding requirejs is not as simple as OcLazyload.

So I've added ocLazyLoad too to load css and to inject the modules.

But anyway here I've stuck with one problem.

I've tried to load the controllers lazily through ocLazyLoad. I've loaded the needed script through require js. When it comes for login routing, I've used OcLazyLoad to load the controller file. And the file has loaded but created a new folder for login controller and got the error like controller is not defined.

Routing

image

LoginController

'use strict'; has been used here.

image

Issue

image

Loaded file structure. 
If I load through require, it is loaded under app folder but not through ocLazyLoad.

image

Jeevanandanj commented 8 years ago

I figured it out.

Basically, requirejs loading the file from app. but I am having the folder name as "App".

requirejs loading the files from the folder correctly.

But when load the files from the folder using ocLazyload like 'App/Login/LoginController', this gives error.

Is this the feature in ocLazyLoad?