From 7871b56eccfe63326b6dd4b56ade3b3afd444fce Mon Sep 17 00:00:00 2001 From: Maria Hutt Date: Tue, 5 Dec 2023 10:43:12 -0800 Subject: [PATCH] fix(angular): add missing menu controller methods (#28618) Issue number: resolves #20053 --------- ## What is the current behavior? There are a few methods that that are missing for the menu in the Angular packages. This leads to users to not being able to use methods like `isAnimating()`. ## What is the new behavior? - The missing methods have been added by implementing `MenuControllerI`. ## Does this introduce a breaking change? - [ ] Yes - [x] No ## Other information Dev build: 7.5.8-dev.11701461830.1be851fd --- .../common/src/providers/menu-controller.ts | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/angular/common/src/providers/menu-controller.ts b/packages/angular/common/src/providers/menu-controller.ts index 0a197b1f5b..2ceb7cba05 100644 --- a/packages/angular/common/src/providers/menu-controller.ts +++ b/packages/angular/common/src/providers/menu-controller.ts @@ -1,6 +1,6 @@ -import type { MenuControllerI } from '@ionic/core/components'; +import type { MenuControllerI, AnimationBuilder, MenuI, Animation } from '@ionic/core/components'; -export class MenuController { +export class MenuController implements MenuControllerI { constructor(private menuController: MenuControllerI) {} /** @@ -98,4 +98,32 @@ export class MenuController { getMenus(): Promise { return this.menuController.getMenus(); } + + registerAnimation(name: string, animation: AnimationBuilder): void { + return this.menuController.registerAnimation(name, animation); + } + + isAnimating(): Promise { + return this.menuController.isAnimating(); + } + + _getOpenSync(): HTMLIonMenuElement | undefined { + return this.menuController._getOpenSync(); + } + + _createAnimation(type: string, menuCmp: MenuI): Promise { + return this.menuController._createAnimation(type, menuCmp); + } + + _register(menu: MenuI): void { + return this.menuController._register(menu); + } + + _unregister(menu: MenuI): void { + return this.menuController._unregister(menu); + } + + _setOpen(menu: MenuI, shouldOpen: boolean, animated: boolean): Promise { + return this.menuController._setOpen(menu, shouldOpen, animated); + } }