Closed iankit3 closed 5 years ago
The goal of ocLazy is helping you "lazy load FILES" . Once you have loaded the js files, you can use any things from the files (Ctrl, directive... )
If you have just a few js files and small code base, don't bother with oclazy
^ split those 1500 lines into their own respective files then. there are no magical ways to only pick X lines from a file from server. Or maybe im wrong, maybe you know the magic lol. To be Frank (Ocean), if you are not modularizing, why even bother with angular
just gonna put this here https://scotch.io/tutorials/angularjs-best-practices-directory-structure and you rather spending "Time" searching for a lazy, non-existent magic, rather than spending the "TIMe" to understand the code base to make it more efficient, you do you m8. See what approach save you more "Time", peace
well since your time is so damn precious, let's see directive life circle
I bet at this point in time, your "complex" app doesnt even need prelink and link, maybe even compile...
split your 1500 lines (it's not that many really), into reusable parts -> load them via dependencies, in order... eg: load necessary controller for a directive, then load the said directive -> that way the controller is reusable. damn that takes so much "time"
then you will ask, how to load them in order, damn im glad you ask...now you move into a module management...eg commonjs, or requirejs, or roll out your own...that will require more "time", so i guess you wont need them
Can i Lazy-Load a directive as in picture
My code is not Modular so i want to lazy load the directive itself Is it Possible ? Or i should make my code modular first and try lazyLoad the modules