Skip to content

marvinderksen/angular-portal-builder

Repository files navigation

AngularPortalBuilder

Use @angular/cdk's PortalOutlet instead of if/else or switches in your templates :)

Why? Because of this:

<ng-container [ngSwitch]="node.type">
  <app-cab *ngSwitchCase="'cab'"></app-cab>
  <app-flight *ngSwitchCase="'flight'"></app-flight>
  <app-train *ngSwitchCase="'train'"></app-train>
  <app-walk *ngSwitchCase="'walk'"></app-walk>
</ng-container>

Installation

npm install angular-portal-builder

Usage

Please have a look at the lib's readme.

Example

You will find a small example application at examples/a2b.

Practice

See the example-application on any practice-branch for katas.

Massive thanks

to the Angular Components team!

About

Use @angular/cdk PortalOutlet with ease!

Resources

License

Stars

Watchers

Forks

Packages

No packages published