Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 557 Bytes

on-page-unloaded.decorator.md

File metadata and controls

24 lines (20 loc) · 557 Bytes

@OnPageUnloaded()

Decorate the method in the controller to run when the page is status unloaded.

Example:

import { Component, OnDestroy, Inject, OnInit } from '@angular/core';
import { OnPageUnloaded } from "angular-page-visibility";

@Component( {
    selector : 'app-root',
    templateUrl : './app.component.html',
    styleUrls : [ './app.component.scss' ]
} )
export class AppComponent implements OnDestroy, OnInit {
  ...
  @OnPageUnloaded()
  logWhenPageUnloaded (): void {
    console.log( 'OnPageUnloaded => unloaded' );
  }
  ...
}