Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic.beta.11 Register Animations for the menu. #15701

Closed
Yomyer opened this issue Sep 21, 2018 · 1 comment
Closed

Ionic.beta.11 Register Animations for the menu. #15701

Yomyer opened this issue Sep 21, 2018 · 1 comment
Assignees

Comments

@Yomyer
Copy link
Contributor

Yomyer commented Sep 21, 2018

Feature Request

Ionic Info
Run ionic info from a terminal/cmd prompt and paste the output below.

Ionic:

   ionic (Ionic CLI)          : 4.1.2 (/usr/local/lib/node_modules/ionic)
   Ionic Framework            : @ionic/angular 4.0.0-beta.11
   @angular-devkit/core       : 0.8.2
   @angular-devkit/schematics : 0.8.2
   @angular/cli               : 6.1.2
   @ionic/ng-toolkit          : 1.0.8
   @ionic/schematics-angular  : 1.0.6

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.1.0, browser 5.0.4, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 1.1.1, (and 13 other plugins)

System:

   ios-deploy : 1.9.2
   ios-sim    : 6.1.2
   NodeJS     : v10.10.0 (/usr/local/Cellar/node/10.10.0/bin/node)
   npm        : 6.4.1
   OS         : macOS High Sierra
   Xcode      : Xcode 9.4.1 Build version 9F2000

Describe the Feature Request
Earlier I was able to register my own animation/transition for the menu using the public registerAnimation method of ion-menu-controller. But with version 11 this is no longer possible as it is now private. My code:

import { customMenuAnimation } from './animations/custom-menu.animation';

const menuCtrl: HTMLIonMenuControllerElement = document.querySelector('ion-menu-controller');
  menuCtrl.componentOnReady().then(comp => {
  proxyMethod('ion-menu-controller' 'registerAnimation', 'custom-menu-animation', customMenuAnimation);
});

Describe Preferred Solution
My suggestion is to be able to take advantage of the Angular MenuController to register different animations and to be able to use them in the ionic init with menuType: 'custom-animation-menu'. It would be optimal since you should not cheat using querySelector, componentOnReady and proxyMethod.

Describe Alternatives

import { customMenuAnimation } from './animations/custom-menu.animation';
import { MenuController } from '@ionic/angular';

export class AppComponent {
  constructor(
    private menuCtrl: MenuController
  ) {
    this.menuCtrl.registerAnimation('custom-menu-animation, revealWithBackdropAnimation);
  }
}

.....
   IonicModule.forRoot({
      mode: 'md',
      menuType: 'custom-menu-animation'
   }),
....

Thank you very much ;)

@ionitron-bot ionitron-bot bot added the triage label Sep 21, 2018
@manucorporat manucorporat self-assigned this Sep 25, 2018
@ionitron-bot ionitron-bot bot removed the triage label Sep 25, 2018
@ionitron-bot
Copy link

ionitron-bot bot commented Oct 25, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants