當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript application.run函數代碼示例

本文整理匯總了TypeScript中tns-core-modules/application.run函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript run函數的具體用法?TypeScript run怎麽用?TypeScript run使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了run函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: require

import "./bundle-config";
import * as application from 'tns-core-modules/application';
import { UnhandledErrorEventData } from "tns-core-modules/application";

// added this here so we can do some wiring
require("nativescript-plugin-firebase");

// testing this.. we may be able to hook that up to Crashlytics. Either via docs, or automatically.
application.on(application.uncaughtErrorEvent, (args: UnhandledErrorEventData) => {
  console.log("[app.js]: Uncaught NativeScript Error: " + args.error);
});

application.run({ moduleName: "main-page" });
開發者ID:NathanWalker,項目名稱:nativescript-plugin-firebase,代碼行數:13,代碼來源:app.ts

示例2:

import * as application from "tns-core-modules/application";
// trace.addCategories(trace.categories.All);
// application.run({ moduleName: "modaltest/page.1" });
// application.run({ moduleName: "modaltest/main-page" });

application.run({ moduleName: "modaltest/modal-tab" });
// application.run({ moduleName: "modaltest/textview" });

// application.start({ moduleName: "modaltest/modal-tab.33" });
// application.run({ moduleName: modaltest/modal-frame" });
// application.start({ moduleName: "modaltest/page.2" });
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:11,代碼來源:app.ts

示例3:

import * as application from 'tns-core-modules/application';

application.run({moduleName: 'app-root'});
開發者ID:triniwiz,項目名稱:nativescript-socketio,代碼行數:3,代碼來源:app.ts

示例4:

/*
In NativeScript, the app.ts file is the entry point to your application.
You can use this file to perform app-level initialization, but the primary
purpose of the file is to pass control to the app’s first module.
*/

import * as app from "tns-core-modules/application";

app.run({ moduleName: "app-root" });

/*
Do not place any code after the application has been started as it will not
be executed on iOS.
*/
開發者ID:anarchicknight,項目名稱:nativescript-vibrate,代碼行數:14,代碼來源:app.ts

示例5:

import * as application from "tns-core-modules/application";

application.run({ moduleName: "app-root" });
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:3,代碼來源:app.ts


注:本文中的tns-core-modules/application.run函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。