Giter Club home page Giter Club logo

ng-polymorpheus's Introduction

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.

Polymorpheus

What does it do?

It abstracts over different ways of view customization in Angular with one simple attribute component:

<header polymorpheus-outlet [content]="content" [context]="context"></header>

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.

Open-source

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.

ng-polymorpheus's People

Contributors

dependabot[bot] avatar marsibarsi avatar waterplea avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.