Handle hardware back button


#1

Hi, how handle hardware back button in one page app? I read about this
$ionicPlatform.registerBackButtonAction(function(){
if($ionicHistory.currentStateName === ‘someStateName’){
event.preventDefault();
}else{
$ionicHistory.goBack();
}
}, 100);

but i have a file browser app that have just one page with a list of files?
How can i disable hardware back button at first path of files?