4.3.0 • Published 5 months ago

@tinkoff/ng-polymorpheus v4.3.0

Weekly downloads
420
License
Apache-2.0
Repository
github
Last release
5 months ago

Polymorpheus

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:

<ng-container *polymorpheusOutlet="content as text; context: context">{{text}}</ng-container>

Content accepts:

  • primitives like number or string
  • functions that take context as argument and return a primitive
  • templates that get instantiated with given context
  • components that would get context 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.

You can also read about this concept in detail.

4.3.0

5 months ago

4.2.0

7 months ago

4.1.0

1 year ago

4.0.11

1 year ago

4.0.9

1 year ago

4.0.8

1 year ago

4.0.10

1 year ago

4.0.7

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.6

2 years ago

4.0.1

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

3.1.12

2 years ago

3.1.11

3 years ago

3.1.10

3 years ago

3.1.9

3 years ago

3.1.3

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.1.7

3 years ago

3.1.6

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

4.0.0

3 years ago

3.1.8

3 years ago

3.0.0

3 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago