Secret menu in an Ionic App

I wanted a way for people to be able to reset the app, kind of for debugging purposes and while a “reset button” works, I don’t think it’s best to have it public.

So, after looking around, I thought that maybe a hold for 5 seconds with a counter would work. However, I came across a post asking a similar, but not the same idea and it triggered my mind to try something different.

Basically, you tap and hold 5 times on the ‘Header Text’ and then, your secret function will trigger.

Here’s my example:

Please note, WordPress source-code formatting is terrible.


<ion-title (press)="pressEvent($event)">About App {{press_text}}</ion-title>

<ion-content padding>
<h1>App Name</h1>
<p>Version: 1</p>
<p>Created with love by me </p>



import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams, ModalController } from 'ionic-angular';
import { Storage } from '@ionic/Storage';
import { StartPopupPage } from '../start-popup/start-popup';

* Generated class for the AboutPage page.

 selector: 'page-about',
 templateUrl: 'about.html',

export class AboutPage 
  publicnavCtrl: NavController,
  privatestorage: Storage,
  privatemodal: ModalController,
  publicnavParams: NavParams) 

 publicpress: number = 0;
 publicpress_text: string = "";
  this.press_text = + "";
  if ( >= 5)
   // Do something after the header has been pressed 5 times.
   // In this case, it runs the function and the resets everything
   // back to 0 ready to reset the function again if required.
   this.resetSettings(); = 0;
   this.press_text = "";

  console.log('ionViewDidLoad AboutPage');

// Doing something after the header has been pressed 5 times.
 async resetSettings()
  // clear out the data'Settings1', null);'Settings2', null);
  // Show a modal.
  // You'll need a popup html page too 
  constprofileModal = this.modal.create(StartPopupPage);
  profileModal.onDidDismiss(data => 

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a free website or blog at

Up ↑

%d bloggers like this: