An open API service indexing awesome lists of open source software.

https://github.com/embeddedenterprises/ngx-golden-layout-dynamic-library

Dynamically loaded library which can be used with electron and golden-layout
https://github.com/embeddedenterprises/ngx-golden-layout-dynamic-library

Last synced: 10 months ago
JSON representation

Dynamically loaded library which can be used with electron and golden-layout

Awesome Lists containing this project

README

          

# ngx-golden-layout-dynamic-library

This library demonstrates the build process and the lazy loading of dynamic libraries using ngx-golden-layout and angular ivy.
To get you started building an own library:

- Create a new library using `ng g lib YOUR_LIBNAME` (memorize the library name, it is important)
- If not done, install dependencies: `npm i -D ngx-golden-layout jquery golden-layout @types/jquery`
- Change `tsconfig.lib.json` in your module directory to state `enableIvy: true` under `angularCompilerOptions`
- Change `tsconfig.lib.json` in your module directory to state `jquery` under `types`
- Create your library, declare your components in your libraries main module using `forChild` (see example in `projects/demo-library/src/lib/demo-library.module.ts`)
- Run `ng build YOUR_LIBNAME`

After that, you should end up with a ready-to-use library which you can load in ngx-golden-layout.
To test it here, run
- `npm ci`
- `ng build demo-library`
- `cd dist/demo-library/bundles`
- `ls`, to get the filename
- run an http server (e.g. `python -m http.server`)

When you're running the ngx-golden-layout-electron project, you might serve the demo library as follows:

![screen.png](screen.png)