'off' of undefined

My Code

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';

import { Flashlight } from '@ionic-native/flashlight';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController,  public fl : Flashlight) {
    setTimeout(function(){ this.HomePage.off(); }, 3000);
  }
  
  public off()
  {
    this.fl.toggle();
  }

}
 

doesn’t exist. You probably mean this.fl?

how to call public off() function in this.HomePage.off();