Skip to content

Commit 7871b56

Browse files
authored
fix(angular): add missing menu controller methods (#28618)
Issue number: resolves #20053 --------- <!-- Please do not submit updates to dependencies unless it fixes an issue. --> <!-- Please try to limit your pull request to one type (bugfix, feature, etc). Submit multiple pull requests if needed. --> ## What is the current behavior? <!-- Please describe the current behavior that you are modifying. --> 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? <!-- Please describe the behavior or changes that are being added by this PR. --> - The missing methods have been added by implementing `MenuControllerI`. ## Does this introduce a breaking change? - [ ] Yes - [x] No <!-- If this introduces a breaking change, please describe the impact and migration path for existing applications below. --> ## Other information <!-- Any other information that is important to this PR such as screenshots of how the component looks before and after the change. --> Dev build: 7.5.8-dev.11701461830.1be851fd
1 parent e2cbc9c commit 7871b56

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

packages/angular/common/src/providers/menu-controller.ts

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { MenuControllerI } from '@ionic/core/components';
1+
import type { MenuControllerI, AnimationBuilder, MenuI, Animation } from '@ionic/core/components';
22

3-
export class MenuController {
3+
export class MenuController implements MenuControllerI {
44
constructor(private menuController: MenuControllerI) {}
55

66
/**
@@ -98,4 +98,32 @@ export class MenuController {
9898
getMenus(): Promise<HTMLIonMenuElement[]> {
9999
return this.menuController.getMenus();
100100
}
101+
102+
registerAnimation(name: string, animation: AnimationBuilder): void {
103+
return this.menuController.registerAnimation(name, animation);
104+
}
105+
106+
isAnimating(): Promise<boolean> {
107+
return this.menuController.isAnimating();
108+
}
109+
110+
_getOpenSync(): HTMLIonMenuElement | undefined {
111+
return this.menuController._getOpenSync();
112+
}
113+
114+
_createAnimation(type: string, menuCmp: MenuI): Promise<Animation> {
115+
return this.menuController._createAnimation(type, menuCmp);
116+
}
117+
118+
_register(menu: MenuI): void {
119+
return this.menuController._register(menu);
120+
}
121+
122+
_unregister(menu: MenuI): void {
123+
return this.menuController._unregister(menu);
124+
}
125+
126+
_setOpen(menu: MenuI, shouldOpen: boolean, animated: boolean): Promise<boolean> {
127+
return this.menuController._setOpen(menu, shouldOpen, animated);
128+
}
101129
}

0 commit comments

Comments
 (0)