MCPcopy Create free account
hub / github.com/NativeScript/NativeScript / createPage

Function createPage

apps/automated/src/pages/file-load-test.ts:3–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1import { Page, Label, knownFolders, path, ModuleNameResolver } from '@nativescript/core';
2
3export function createPage() {
4 var page = new Page();
5 var lbl = new Label();
6
7 var moduleName = 'tests/pages/files/test';
8
9 ModuleNameResolver;
10 var resolver = new ModuleNameResolver({
11 width: 400,
12 height: 600,
13 os: 'android',
14 deviceType: 'phone',
15 });
16
17 // Current app full path.
18 var currentAppPath = knownFolders.currentApp().path;
19 var moduleNamePath = path.join(currentAppPath, moduleName);
20
21 var fileName = resolver.resolveModuleName(moduleNamePath, 'xml');
22 lbl.text = fileName;
23 lbl.textWrap = true;
24
25 page.content = lbl;
26
27 return page;
28}

Callers

nothing calls this directly

Calls 2

resolveModuleNameMethod · 0.95
joinMethod · 0.80

Tested by

no test coverage detected