octicon-rss(16/)
You've already forked ionic-framework
mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 22:44:13 +08:00
feat(angular): expose getSelected() (#17079)
fixes #17068
This commit is contained in:
octicon-git-branch(16/)
octicon-tag(16/)
committed by
GitHub
gitea-unlock(16/)
parent
8789748334
commit
3c801dbe11
octicon-diff(16/tw-mr-1) 8 changed files with 52 additions and 39 deletions
@@ -1,4 +1,4 @@
|
||||
import { Directive, ElementRef, HostListener, Optional } from '@angular/core';
|
||||
import { Directive, HostListener, Optional } from '@angular/core';
|
||||
|
||||
import { NavController } from '../../providers/nav-controller';
|
||||
|
||||
@@ -10,19 +10,16 @@ import { IonRouterOutlet } from './ion-router-outlet';
|
||||
})
|
||||
export class IonBackButtonDelegate {
|
||||
|
||||
set defaultHref(value: string | undefined | null) {
|
||||
this.elementRef.nativeElement.defaultHref = value;
|
||||
}
|
||||
get defaultHref(): string | undefined | null {
|
||||
return this.elementRef.nativeElement.defaultHref;
|
||||
}
|
||||
defaultHref: string | undefined | null;
|
||||
|
||||
constructor(
|
||||
@Optional() private routerOutlet: IonRouterOutlet,
|
||||
private navCtrl: NavController,
|
||||
private elementRef: ElementRef,
|
||||
private navCtrl: NavController
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@HostListener('click', ['$event'])
|
||||
onClick(ev: Event) {
|
||||
if (this.routerOutlet && this.routerOutlet.canGoBack()) {
|
||||
|
||||
@@ -49,6 +49,9 @@ export class IonTabs {
|
||||
private navCtrl: NavController,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@HostListener('ionRouterOutletActivated', ['$event.detail'])
|
||||
onPageSelected(detail: {view: RouteView}) {
|
||||
if (this.tabBar) {
|
||||
@@ -69,4 +72,8 @@ export class IonTabs {
|
||||
animationDirection: 'back'
|
||||
});
|
||||
}
|
||||
|
||||
getSelected(): string | undefined {
|
||||
return this.outlet.getActiveStackId();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ export class RouterLinkDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@HostListener('click', ['$event'])
|
||||
onClick(ev: UIEvent) {
|
||||
this.navCtrl.setDirection(this.routerDirection);
|
||||
|
||||
Reference in New Issue
Block a user