Skip to content

Latest commit

 

History

History
34 lines (26 loc) · 700 Bytes

on-page-hidden.decorator.md

File metadata and controls

34 lines (26 loc) · 700 Bytes

@OnPageHidden()

Decorate the method in the controller to run when the page is hidden.

Example:

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

@Component( {
    selector : 'app-root',
    templateUrl : './app.component.html',
    styleUrls : [ './app.component.scss' ]
} )
export class AppComponent implements OnDestroy, OnInit {
    title = 'app';

    constructor() {
    }

    ngOnInit(): void {
    }

    @OnPageHidden()
    logWhenPageHidden(): void {
        console.log( 'OnPageHidden' );
        console.log( 'hidden' );
    }

    ngOnDestroy(): void {
    }
}