Disable Back button in a specifiq view

hi, how can i disable the hardware backbutton in specific view ? i tried to use the cordova event, https://cordova.apache.org/docs/en/4.0.0/cordova/events/events.backbutton.html

document.addEventListener(‘backbutton’, (e) => {
console.info(“Backbutton :)”);

           let activeVC = this.navCtrl.getActive();
           let page:any = activeVC.instance;

           if ((page instanceof ProductPage)) {
             let answer = confirm("are u sure?");
             if(!answer){
               e.preventDefault();
               e.stopPropagation();
               throw new Error("Action not allowed");
            
             }
               
           }


  }, false);

but this isn’t working