
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
ngx-dynamic-template
Advanced tools
An implementation of dynamic template wrapper at Angular4/5. **AoT mode does not support**, sorry! In case of dynamic component please use ngComponentOutlet.
An implementation of dynamic template wrapper at Angular4/5. AoT mode does not support, sorry! In case of dynamic component please use ngComponentOutlet.
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.
npm install ngx-dynamic-template --save
import { NgxDynamicTemplateModule } from 'ngx-dynamic-template';
@NgModule({
imports: [NgxDynamicTemplateModule.forRoot()]
})
<ng-template dynamic-template
[template]="'<span style=\'color: orange;\'>This is simple dynamic template</span>'">
</ng-template>
<ng-template dynamic-template
[template]="'<lazy-component></lazy-component>'"
[lazyModules]="['lazy']">
</ng-template>
export const ROUTES: Routes = [
{ path: '', component: HomeComponent },
...
{ path: 'lazy', loadChildren: './lazy/lazy.module#LazyModule' }
];
...
@NgModule({
imports: [
...
NgxDynamicTemplateModule.forRoot({ routes: ROUTES }),
RouterModule.forRoot(ROUTES)
],
Also 301, 302, 307, 308 HTTP statuses are supported (recursive redirection). The remoteTemplateFactory is an optional attribute allows parse response and build http request.
<ng-template dynamic-template
[httpUrl]="'https://httpbin.org/get'"
[defaultTemplate]="'<span>on error template</span>'"
[remoteTemplateFactory]="remoteTemplateFactory">
</ng-template>
import { Component, OnInit } from '@angular/core';
import { HttpHeaders } from '@angular/common/http';
import { IDynamicRemoteTemplateFactory, DynamicHttpResponseT, IDynamicHttpRequest } from 'ngx-dynamic-template';
...
remoteTemplateFactory: IDynamicRemoteTemplateFactory = {
// This is an optional method
buildRequestOptions (): IDynamicHttpRequest {
const headers = new HttpHeaders();
headers.append('Token', '100500');
return {
withCredentials: true,
headers: headers
};
},
// This is an optional method
parseResponse (response: DynamicHttpResponseT): string {
return response.body.headers['User-Agent'];
}
};
<ng-template dynamic-template
[template]="template4"
[context]="context4"
[extraModules]="[myExtraModule]"></ng-template>
NgxDynamicTemplateModule.forRoot({ removeDynamicWrapper: true });
Licensed under MIT.
FAQs
An implementation of dynamic template wrapper at Angular4/5. **AoT mode does not support**, sorry! In case of dynamic component please use ngComponentOutlet.
The npm package ngx-dynamic-template receives a total of 216 weekly downloads. As such, ngx-dynamic-template popularity was classified as not popular.
We found that ngx-dynamic-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.