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

Function onShowingModally

apps/ui/src/modal-view/login-page.ts:3–28  ·  view source on GitHub ↗
(args: ShownModallyData)

Source from the content-addressed store, hash-verified

1import { Page, ShownModallyData, EventData, fromObject, Dialogs } from '@nativescript/core';
2
3export function onShowingModally(args: ShownModallyData) {
4 console.log('login-page.onShowingModally, context: ' + args.context);
5 const page = <Page>args.object;
6
7 page.bindingContext = fromObject({
8 username: 'username',
9 password: 'password',
10 context: args.context,
11 onLoginButtonTap: function () {
12 console.log('login-page.onLoginButtonTap');
13 args.closeCallback(this.username, this.password);
14 },
15 showAlert: function () {
16 Dialogs.alert('showing alert!');
17 args.closeCallback();
18 },
19 openNestedModal: function () {
20 page.showModal('modal-view/nested-modal', {
21 context: 'First',
22 closeCallback: () => {
23 console.log('login-page.openNestedModal');
24 },
25 });
26 },
27 });
28}
29
30export function onShownModally(args: ShownModallyData) {
31 console.log('login-page.onShownModally, context: ' + args.context);

Callers

nothing calls this directly

Calls 3

fromObjectFunction · 0.90
logMethod · 0.45
closeCallbackMethod · 0.45

Tested by

no test coverage detected