angular-content-portal
TypeScript icon, indicating that this package has built-in type declarations

9.0.3 • Public • Published

angular-content-portal

Build Status Coverage Status dependencies Status devDependencies Status Codacy Badge

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

Requirements

  • Angular 9+

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 {}
<!-- You can now use your library component in app.component.html -->
<ac-portal-outlet name="header-actions"></ac-portal-outlet>

then

<!-- You can now use your library component in user/create-user.component.html -->
<ac-portal name="header-actions">
  <button>Add user</button>
</ac-portal>

License

MIT © John Cashmore

Readme

Keywords

none

Package Sidebar

Install

npm i angular-content-portal

Weekly Downloads

7

Version

9.0.3

License

none

Unpacked Size

132 kB

Total Files

29

Last publish

Collaborators

  • johncashmore
  • spacedawwwg