0

How to close the menu dropdown once clicked using typescript. I am able to do using jQuery but I am working on angular 2. I would like to it in typescript

AT82
  • 71,416
  • 24
  • 140
  • 167
sweety
  • 1

2 Answers2

0

You can use this :

<div (click)='clicked = !clicked'>
  <menu [hidden]='clicked'>
  .......
  </menu>
</div>
Vivek Doshi
  • 56,649
  • 12
  • 110
  • 122
0

If you are working on ionic 2 then following are the steps to hide menu...

First import Menucontroller from import {MenuController} from 'ionic-angular';

In your component constructor include menuController like this : constructor(app: IonicApp, platform: Platform, menu: MenuController)

Then wherever you wish to close menu do this : this.menu.close();

If you are not using ionic 2 then tell me if u using any plugin in angular for menu? then i can help u with the solution.

Hope this helps..

Irfan Pathan
  • 309
  • 1
  • 3
  • 14