
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@taiga-ui/polymorpheus
Advanced tools
Polymorpheus is a tiny library for polymorphic templates in Angular.
It is 1 KB gzip, dependency free and allows you to make pretty cool things.
It abstracts over different ways of view customization in Angular with one simple structural directive:
<ng-container *polymorpheusOutlet="content as text; context: context">{{text}}</ng-container>
Content accepts:
number or stringcontext as argument and return a primitivecontextcontext injected through DIContext is optional when you need your content to adapt to the situation
Typical use case would be a component that accepts visual customization and defines context by itself. Say a menu list where you can configure how each item should look like by passing a template. And context would be item itself and, for example, whether it is focused or not.
Please see extensive demo (wait for packages to install and run
npm start).
You can also read about this concept in detail.
If you use component content you can inject context with POLYMORPHEUS_CONTEXT token or injectContext helper.
Important: this object is live so if you change it, your component view will be updated as well automatically.
import {injectContext} from '@taiga-ui/polymorpheus';
@Component({
template: '{{ context.active }}', // <-- this will automatically update
})
export class MyComponent {
protected readonly context = injectContext<{active: boolean}>();
}
Alternatively, inputs can be used and will be synced with according context keys:
import {input} from '@angular/core';
@Component({
template: '{{ active() }}',
})
export class MyComponent {
// Will be automatically updated by context.active changes
protected readonly active = input(false);
}
You can use polymorpehus directive to add type to template context:
readonly context!: { $implicit: number };
<ng-template
#template="polymorpheus"
[polymorpheus]="context"
let-item
>
{{ item.toFixed(2) }} <-- type 'number'
</ng-template>
![]() Alex Inkin |
![]() Roman Sedov |
ng-polymorpheus is a part of Taiga UI libraries family which is backed and used by a large enterprise. This means you can rely on timely support and continuous development.
FAQs
This is a tiny library for customizing components appearance
We found that @taiga-ui/polymorpheus demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers 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.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.