Hide or show selective side menu items based on active tab

#1

How to hide or show a specific side menu item based on an active tab.
I use Ionic4.
My menu items are listed in AppComponent class as an array variable.

Below is a sample code.
‘Create account’ menu should show only when I choose ‘Accounts’ tab page
‘New post’ menu should show only when I choose ‘Posts’ tab page

  public appPages = [
    {title:'Create account',url:'/create-account'},
    {title:'New post',url:'/new-post},
    ];