In Boilerplatejs Browser Is Loading All The Scripts (in Other Modules) Regardless Of The Module Activated
Solution 1:
There are few things to note here.
First regarding the files that load: In your production deployment, all these files will be combined, minified and obfuscated by the BoilerplateJS optimizer. Meaning, anyway all your code will be in a single script in production, this is normal in AMD JavaScript applications.
Even though the code are loaded, the individual components will not be rendered until they receive an activation call from a front controller. Your module will register the UI components, at the initial application load time, but real creation of the UI component happens only in the 'activate' function of your component. This will ensure the application load time is faster and UI component creation happens only on demand.
You should never depend on client side authorization in the application. All your JS code will go to the client browser and has potential to get modified. But for user friendliness, you may hide operation that are not permisible to the user. Where to do it depends on the granularity of control. If you want it at component level, you may do this on the navigation menu itself.
Post a Comment for "In Boilerplatejs Browser Is Loading All The Scripts (in Other Modules) Regardless Of The Module Activated"