Need help with ng-polymorpheus?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

254 Stars 15 Forks Apache License 2.0 84 Commits 1 Opened issues


Polymorpheus is a tiny library for polymorphic templates in Angular.

Services available


Need anything else?

Contributors list


npm version Build Status Coverage Status angular-open-source-starter

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.


What does it do?

It abstracts over different ways of view customization in Angular with one simple structural directive:


Content accepts:

  • primitives like
  • functions that take
    as argument and return a primitive
  • templates that get instantiated with given
  • components that would get
    injected through DI

Context is optional when you need your content to adapt to the situation

How to use it?

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.

Accessing context in dynamic component

If you use component content you can inject context with


Important! This object is live so if you change it, your component will not be recreated:

  template: '{{}}`, // 

Adding type to template context

You can use

directive to add type to template context:
readonly context!: { $implicit: number };
    {{ item.toFixed(2) }} 


Do you also want to open-source something, but hate the collateral work? Check out this Angular Open-source Library Starter we’ve created for our projects. It got you covered on continuous integration, pre-commit checks, linting, versioning + changelog, code coverage and all that jazz.

Core team

Alex Inkin
Alex Inkin
Roman Sedov
Roman Sedov

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.