mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-09 16:16:41 +08:00
fix(nav): getLength is part of the public API (#28832)
resolves #28826 BREAKING CHANGE: `getLength` returns `Promise<number>` instead of `<number>`. This method was not previously available in Nav's TypeScript interface, but developers could still access it by casting Nav as `any`. Developers should ensure they `await` their `getLength` call before accessing the returned value.
This commit is contained in:
@ -483,8 +483,12 @@ export class Nav implements NavOutlet {
|
||||
return this.getPreviousSync(view);
|
||||
}
|
||||
|
||||
getLength() {
|
||||
return this.views.length;
|
||||
/**
|
||||
* Returns the number of views in the stack.
|
||||
*/
|
||||
@Method()
|
||||
async getLength(): Promise<number> {
|
||||
return Promise.resolve(this.views.length);
|
||||
}
|
||||
|
||||
private getActiveSync(): ViewController | undefined {
|
||||
|
||||
Reference in New Issue
Block a user