angular-content-portal
![Codacy Badge](https://api.codacy.com/project/badge/Grade/13e634f2f4364443bf44c3438ced9b06)
A simple library that uses the @angular/cdk library to give a quick way of portaling(?) content outside of your component.
![Rick and Morty Portal Gun](http://paulwelsh.info/angular-content-portal/portal-gun.jpg)
Requirements
Demo
StackBlitz demo
Installation
To install this library, run:
$ npm install angular-content-portal --save
Using angular-content-portal
From your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { AngularContentPortalModule } from 'angular-content-portal';
@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, AngularContentPortalModule],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {}
<ac-portal-outlet name="header-actions"></ac-portal-outlet>
then
<ac-portal name="header-actions">
<button>Add user</button>
</ac-portal>
License
MIT © John Cashmore