UNPKG

@ionic/angular

Version:

Angular specific wrappers for @ionic/core

60 lines 3.7 kB
import { __decorate } from "tslib"; import { ViewChild, ViewContainerRef, Component, Attribute, Optional, SkipSelf, } from '@angular/core'; import { IonRouterOutlet as IonRouterOutletBase, ProxyCmp } from '@ionic/angular/common'; import { defineCustomElement } from '@ionic/core/components/ion-router-outlet.js'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common"; import * as i2 from "@angular/router"; let IonRouterOutlet = class IonRouterOutlet extends IonRouterOutletBase { parentOutlet; /** * `static: true` must be set so the query results are resolved * before change detection runs. Otherwise, the view container * ref will be ion-router-outlet instead of ng-container, and * the first view will be added as a sibling of ion-router-outlet * instead of a child. */ outletContent; /** * We need to pass in the correct instance of IonRouterOutlet * otherwise parentOutlet will be null in a nested outlet context. * This results in APIs such as NavController.pop not working * in nested outlets because the parent outlet cannot be found. */ constructor(name, tabs, commonLocation, elementRef, router, zone, activatedRoute, parentOutlet) { super(name, tabs, commonLocation, elementRef, router, zone, activatedRoute, parentOutlet); this.parentOutlet = parentOutlet; } /** @nocollapse */ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: IonRouterOutlet, deps: [{ token: 'name', attribute: true }, { token: 'tabs', attribute: true, optional: true }, { token: i1.Location }, { token: i0.ElementRef }, { token: i2.Router }, { token: i0.NgZone }, { token: i2.ActivatedRoute }, { token: IonRouterOutlet, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); /** @nocollapse */ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0", type: IonRouterOutlet, isStandalone: true, selector: "ion-router-outlet", viewQueries: [{ propertyName: "outletContent", first: true, predicate: ["outletContent"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: '<ng-container #outletContent><ng-content></ng-content></ng-container>', isInline: true }); }; IonRouterOutlet = __decorate([ ProxyCmp({ defineCustomElementFn: defineCustomElement, }) ], IonRouterOutlet); export { IonRouterOutlet }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: IonRouterOutlet, decorators: [{ type: Component, args: [{ selector: 'ion-router-outlet', standalone: true, template: '<ng-container #outletContent><ng-content></ng-content></ng-container>', }] }], ctorParameters: () => [{ type: undefined, decorators: [{ type: Attribute, args: ['name'] }] }, { type: undefined, decorators: [{ type: Optional }, { type: Attribute, args: ['tabs'] }] }, { type: i1.Location }, { type: i0.ElementRef }, { type: i2.Router }, { type: i0.NgZone }, { type: i2.ActivatedRoute }, { type: IonRouterOutlet, decorators: [{ type: SkipSelf }, { type: Optional }] }], propDecorators: { outletContent: [{ type: ViewChild, args: ['outletContent', { read: ViewContainerRef, static: true }] }] } }); //# sourceMappingURL=router-outlet.js.map