本文整理匯總了TypeScript中application.start函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript start函數的具體用法?TypeScript start怎麽用?TypeScript start使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了start函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
import * as applicationModule from 'application';
import * as navigationModule from './shared/navigation';
applicationModule.mainModule = navigationModule.loginPage();
applicationModule.start();
示例2: moment
import * as application from "application";
import * as moment from "moment";
application.resources.dateFormat = (value: Date, format: string) => {
return moment(value).format(format);
};
application.start({ moduleName: "view/landing-splash" });
示例3:
import * as app from 'application';
app.mainModule = "main-page";
app.cssFile = "./app.css";
app.start();
示例4:
import * as application from 'application';
application.start({ moduleName: 'login/login' });
示例5: function
import * as appModule from 'application';
import * as navigationModule from './shared/navigation';
if(appModule.android) {
appModule.onLaunch = function (intent) {
console.log('onLaunch');
appModule.android.onActivityCreated = function (activity) {
console.log('onCreated');
var id = activity.getResources().getIdentifier('AppTheme', 'style', activity.getPackageName());
activity.setTheme(id);
}
appModule.android.onActivityStarted = function (activity) {
console.log('onStarted');
var window = activity.getWindow();
if (window) {
window.setBackgroundDrawable(null);
}
}
}
}
// Set the start module for the application
appModule.mainModule = navigationModule.startingPage();
appModule.cssFile = 'styles/app.css';
// Start the application
appModule.start();
示例6:
import * as application from 'application';
application.mainModule = "main-page";
application.cssFile = "./app.css";
application.start();
示例7:
import * as app from 'application';
app.start({ moduleName: "main-page" });
示例8:
import * as application from "application";
application.cssFile = "./tns_modules/nativescript-unit-test-runner/app.css";
application.start({ moduleName: "./tns_modules/nativescript-unit-test-runner/main-page" });