Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit f9c61e3

Browse files
refactor: deprecated topmost() usage
1 parent c22d44e commit f9c61e3

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

‎nativescript-angular/directives/dialogs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { AppHostView } from "../app-host-view";
1717
import { DetachedLoader } from "../common/detached-loader";
1818
import { PageFactory, PAGE_FACTORY } from "../platform-providers";
1919
import { once } from "../common/utils";
20-
import { topmost,Frame } from "tns-core-modules/ui/frame";
20+
import { Frame } from "tns-core-modules/ui/frame";
2121
import { ShowModalOptions } from "tns-core-modules/ui/core/view";
2222

2323
export type BaseShowModalOptions = Pick<ShowModalOptions, Exclude<keyof ShowModalOptions, "closeCallback" | "context">>;
@@ -86,7 +86,7 @@ export class ModalDialogService {
8686

8787
let frame = parentView;
8888
if (!(parentView instanceof Frame)) {
89-
frame = (parentView.page && parentView.page.frame) || topmost();
89+
frame = (parentView.page && parentView.page.frame) || Frame.topmost();
9090
}
9191

9292
this.location._beginModalNavigation(frame);

‎nativescript-angular/platform-providers.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { InjectionToken, Injectable } from "@angular/core";
22

3-
import { topmost,Frame } from "tns-core-modules/ui/frame";
3+
import { Frame } from "tns-core-modules/ui/frame";
44
import { View } from "tns-core-modules/ui/core/view";
55
import { Page } from "tns-core-modules/ui/page";
66
import { device, Device } from "tns-core-modules/platform";
@@ -26,7 +26,7 @@ export function getDefaultPage(): Page {
2626
return rootPage;
2727
}
2828

29-
const frame = topmost();
29+
const frame = Frame.topmost();
3030
if (frame && frame.currentPage) {
3131
return frame.currentPage;
3232
}
@@ -38,7 +38,7 @@ export const defaultPageProvider = { provide: Page, useFactory: getDefaultPage }
3838

3939
// Use an exported function to make the AoT compiler happy.
4040
export function getDefaultFrame(): Frame {
41-
return topmost();
41+
return Frame.topmost();
4242
}
4343

4444
export const defaultFrameProvider = { provide: Frame, useFactory: getDefaultFrame };
@@ -67,7 +67,7 @@ export const defaultPageFactoryProvider = { provide: PAGE_FACTORY, useValue: def
6767
export class FrameService {
6868
// TODO: Add any methods that are needed to handle frame/page navigation
6969
getFrame(): Frame {
70-
let topmostFrame = topmost();
70+
let topmostFrame = Frame.topmost();
7171
return topmostFrame;
7272
}
7373
}

‎nativescript-angular/router/ns-location-strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ export class NSLocationStrategy extends LocationStrategy {
411411
this._modalNavigationDepth--;
412412
}
413413

414-
// currentOutlet should be the one that corresponds to the topmost() frame
414+
// currentOutlet should be the one that corresponds to the topmost frame
415415
const topmostOutlet = this.getOutletByFrame(this.frameService.getFrame());
416416
const outlet = this.findOutletByModal(this._modalNavigationDepth, isShowingModal) || topmostOutlet;
417417

‎nativescript-angular/testing/src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import { View } from "tns-core-modules/ui/core/view";
3-
import { topmost } from "tns-core-modules/ui/frame";
3+
import { Frame } from "tns-core-modules/ui/frame";
44
import { LayoutBase } from "tns-core-modules/ui/layouts/layout-base";
55
import { ComponentFixture, TestBed } from "@angular/core/testing";
66
import { NgModule, Type } from "@angular/core";
@@ -17,7 +17,7 @@ const TESTING_ROOT_ID = "__testing_container";
1717
* Get a reference to the fixtures container.
1818
*/
1919
export function testingRootView(): LayoutBase {
20-
const rootPageLayout = topmost().currentPage.content as LayoutBase;
20+
const rootPageLayout = Frame.topmost().currentPage.content as LayoutBase;
2121

2222
let testingRoot: LayoutBase;
2323
rootPageLayout.eachChild(child => {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /