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, backbutton - Apache Cordova

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