'off' of undefined

#1

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();
  }

}
 
#2

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

#3

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