a4-overlay
v9.0.0
Published
Handle overlay for the entire screen
Readme
a4-overlay
Angular 7 Overlay
How-To
Install
npm install a4-overlayapp.module.ts
- Add
OverlayModuleto imports of theapp.module.ts.
...
import { OverlayModule } from 'a4-overlay';
...
@NgModule({
declarations: [
AppComponent
],
imports: [
...,
OverlayModule,
...
],
...
})app.component.ts
- Add
viewContainerRef: ViewContainerRefto the constructor ofapp.component.ts.
...
import { ViewContainerRef } from '@angular/core';
...
constructor(private viewContainerRef: ViewContainerRef) { }your.component.ts
- Add
overlayService: OverlayServiceto the constructor of your component.
constructor(private overlayService: OverlayService) { }- Invoking the overlay mask can be done by using the service as shown below.
this.overlayService.show(); // to show an overlay over the page
this.overlayService.hide(); // to hide the overlay