GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Toxicable/module-loading

This repository was archived by the owner on Jan 8, 2018. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

22 Commits
22 Commits

Folders and files

NameName
Last commit message
Last commit date
dynamic
dynamic
 
 
static
static
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
tslint.json
tslint.json
 
 

Repository files navigation

module-loading

If you're looking at using this then I highly suggest hold out a little long till you can use Angular Elements, theyr'e a far better fit this this kind of situation. See here for a small demo on what they are: https://www.youtube.com/watch?v=ljsOPm4MMEo
or use another form of dynamic content that you can find out about here: https://www.youtube.com/watch?v=__H65AsA_bE&feature=youtu.be&t=2h14m13s
and demo here: https://stackblitz.com/edit/angular-dynamic-content-viewer


This repo has 2 examples of how to dynamically load Modules in Angular

Static

This shows how you can load in a module similar to how @angular/router does.
Here we require the module to be known at build time.
Do note that it also makes use of a private API on this line

const compType = moduleFactories['LazyCompNgFactory']._componentType;

Noted by the _, do not use this API unless you want to risk it being broken in the future since private API's are not subject to any of Angular's policies on breaking changes.
This is mainly for comparison to the more dynamic way.

Dynamic

This is the main feature of this repository.
Here the plugin (Angular module) does not need to be known at build time for the main application to be built.
With this method you can make plugins independantly of the main application.
This is accomplished through the use of Webpack and Rollup and externalising dependencies.
However, the issue with doing this is that all your dependencies must be loaded in as UMD bundles, which means that you loose all global optimisations. Meaning that you wont be able to do tree shaking or similar optimisations.

If you have any questions feel free to make an issue or ping on on Gitter with @Toxicable

About

No description, website, or topics provided.

Resources

Readme
MIT license
Activity

Stars

18 stars

Watchers

1 watching

Forks

13 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.