Skip to content

Dynamically load an angular module into an angular application

License

Notifications You must be signed in to change notification settings

andreElrico/dynamic-module-loading

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dynamic Module Loading

  • This project was based on work done by Thibaud Arnault: https://github.com/webshell/materia-sendgrid
  • The addon module is now served using http-server and the main application runs in a browser instead of Electron.
  • Some extraneous code was removed and the package files are updated to use the latest Angular 5.2.
  • The webpack.config file is a newly created Angular 5.2 project that has been ejected (ng eject), no additional changes were made to the webpack configuration.

Install

git clone [email protected]:nmarra/dynamic-module-loading.git
cd dynamic-module-loading
chmod +x setup.sh
./setup.sh

Serve the Addon Module

cd addon
npm run serve

Run the Main App

cd main-app
npm run start-webpack

Testing dynamic reloading

  • Once the main application is running and the user has loaded the dynamic component and seen it working, then go into the addon-view.component.css and change one of the colors and rebuild the addon ( npm run build in /addon ). Then clear the browser cache, refresh the main application, and notice when pressing the 'load dynamic component' button that the new dynamic component is now loaded without needing to rebuild/redeploy the main application.

About

Dynamically load an angular module into an angular application

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 56.0%
  • TypeScript 38.9%
  • HTML 3.9%
  • Other 1.2%