ngx-dynamic-template
An implementation of dynamic template wrapper at Angular4/5. AoT mode does not support, sorry! In case of dynamic component please use ngComponentOutlet.
Description
Date of creation: 18 Jun 2016 [started with Angular 2.0.0-rc.2].
The previous version of this module is tandem angular2-dynamic-component and ts-metadata-helper. The last source code version of the angular2-dynamic-component you can see here.
Installation
npm install ngx-dynamic-template --save
;
Demo
- Based on angular-cli
- npm run build -- -prod
- aot flag must be disabled, aot: false, see angular/cli/models/webpack-config.ts
- Based on angular-cli
- npm run build -- -prod
- aot flag must be disabled, aot: false, see angular/cli/models/webpack-config.ts
- Based on Angular 2 Webpack Starter
- npm run build:prod
Features
1 Support of dynamic-template directive.
2 Support of lazy loaded component modules for the dynamic templates via lazyModules input parameter (demo scenario #4).
; ...
3 Support of httpUrl attribute. This attribute allows getting resource via Angular2 HTTP/Ajax (demo scenario #3).
Also 301, 302, 307, 308 HTTP statuses are supported (recursive redirection). The remoteTemplateFactory is an optional attribute allows parse response and build http request.
; ; ; ... remoteTemplateFactory: IDynamicRemoteTemplateFactory =;
4 Support for injecting the extra modules via extraModules input parameter.
5 Support of caching of compiled modules for the specific dynamic template. Therefore you can render a huge amount of dynamic templates at the same time (demo scenario #5).
6 Support of recursive injection the dynamic module instance (dynamic component inside dynamic component).
7 Clearing dynamic wrapper using the removeDynamicWrapper option.
NgxDynamicTemplateModule.forRoot;
License
Licensed under MIT.