Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora

0

105
Vistas
ion-menu is not doing animation, how to add animation

I saw it in the ionic documentation but I couldn't find anything about it. When I click on the button to open the menu it is opening normally but without any animation, how do I add an animation for when the menu opens and closes???

      <div class="toatal_pages">
        <ion-menu side="start" menuId="first" contentId="main" >
          <ion-content>
            info
            </ion-content>
        </ion-menu>
        <div class="right> id="main">
        <button (click)="openMenu()"> OPEN MENU</button>
        </div>
      </div>
      
      
        async openMenu() {
          await this.menuController.open();
        }

7 months ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Kindly make sure you are importing it from angular import { MenuController } from '@ionic/angular';

#Try this.

 // template code :
<ion-menu side="start" menuId="first" contentId="main">
  <ion-header>
    <ion-toolbar color="primary">
      <ion-title>Start Menu</ion-title>
    </ion-toolbar>
 </ion-header>
<ion-content>
 <ion-list>
  <ion-item>Menu Item</ion-item>
  <ion-item>Menu Item</ion-item>
  <ion-item>Menu Item</ion-item>
  <ion-item>Menu Item</ion-item>
  <ion-item>Menu Item</ion-item>
</ion-list>
//TypeScript code 
constructor(private menu: MenuController) { }

openMenu() {
    this.menu.enable(true, 'first');
    this.menu.open('first');
}
7 months ago · Juan Pablo Isaza Denunciar

0

If you are talking about the default animations then ensure that you have the CSS provided from ionic are imported in the app

For custom animations you will need to follow the following Documentation from Ionic

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos