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


TypeScript application.start函數代碼示例

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


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

示例1:

/*
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.start({ moduleName: "main-page" });

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

示例2:

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

// Needed only for build infrastructure
application.setCssFileName("devtools-app/app.css");

application.start({ moduleName: "devtools-app/main-page" });
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:6,代碼來源:app.ts

示例3:

import * as application from 'tns-core-modules/application';
application.start({ moduleName: 'main-page' });
開發者ID:bradmartin,項目名稱:nativescript-audio,代碼行數:2,代碼來源:app.ts

示例4: if

    if (args.android) {
        // For Android applications, args.android is an NativeScriptError.
        console.log("NativeScriptError: " + args.android);
    } else if (args.ios) {
        // For iOS applications, args.ios is NativeScriptError.
        console.log("NativeScriptError: " + args.ios);
    }
});


// var MyAppDelegate = UIResponder.extend({
//     // Implement a method from UIApplicationDelegate.
//     // We will obtain the method signature from the protocol.
//     canBecomeFirstResponder: function() {
//       return true;
//     },
//     applicationDidFinishLaunchingWithOptions: function (application, launchOptions) {
//       console.log('========== APP LAUNCHED ==========');
//       this.becomeFirstResponder();
//     }
// }, {
//     // The name for the registered Objective-C class.
//     name: "MyAppDelegate",
//     // Declare that the native Objective-C class will implement the UIApplicationDelegate Objective-C protocol.
//     protocols: [UIApplicationDelegate]
// });

// application.ios.delegate = MyAppDelegate;
import "./bundle-config";
application.start({ moduleName: "main-page" });
開發者ID:Notalib,項目名稱:nativescript-audioplayer,代碼行數:30,代碼來源:app.ts

示例5:

import * as application from "tns-core-modules/application";
import * as trace from "tns-core-modules/trace";
trace.addCategories(
    trace.categories.Transition)
// + "," + 
//     trace.categories.NativeLifecycle + "," + 
//     trace.categories.Navigation);
trace.enable();

// Needed only for build infrastructure
application.setCssFileName("navigation-app/app.css");
application.start({ moduleName: "navigation-app/main-page" });
開發者ID:triniwiz,項目名稱:NativeScript,代碼行數:12,代碼來源:app.ts

示例6:

import * as application from "tns-core-modules/application";
application.start({ moduleName: "apps/tests/pages/nnikolovTestPage" });
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:2,代碼來源:sandbox-project.ts

示例7:

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

import * as trace from "tns-core-modules/trace";
trace.enable();
trace.setCategories(trace.categories.concat(
    trace.categories.Layout
//, trace.categories.NativeLifecycle
//, trace.categories.Navigation
//, trace.categories.ViewHierarchy
//, trace.categories.VisualTreeEvents
    ));

application.start({ moduleName: "styling/mainPage" });
開發者ID:NathanWalker,項目名稱:NativeScript,代碼行數:13,代碼來源:app.ts

示例8:

/*
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 './bundle-config';
import * as app from 'tns-core-modules/application';

app.start({ moduleName: 'main-page' });

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


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