本文整理汇总了TypeScript中ui/page.Page.on方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Page.on方法的具体用法?TypeScript Page.on怎么用?TypeScript Page.on使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ui/page.Page
的用法示例。
在下文中一共展示了Page.on方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Page
create: (): Page => {
let page = new Page();
if (appOptions) {
page.actionBarHidden = appOptions.startPageActionBarHidden;
}
let onLoadedHandler = function(args) {
page.off('loaded', onLoadedHandler);
//profiling.stop('application-start');
console.log('Page loaded');
//profiling.start('ng-bootstrap');
console.log('BOOTSTRAPPING...');
bootstrap(appComponentType, customProviders).then((appRef) => {
//profiling.stop('ng-bootstrap');
console.log('ANGULAR BOOTSTRAP DONE.');
}, (err) => {
console.log('ERROR BOOTSTRAPPING ANGULAR');
let errorMessage = err.message + "\n\n" + err.stack;
console.log(errorMessage);
let view = new TextView();
view.text = errorMessage;
page.content = view;
});
}
page.on('loaded', onLoadedHandler);
return page;
}
示例2: Page
create: (): Page => {
const page = new Page();
const root = new StackLayout();
page.content = root;
let onLoadedHandler = function(args) {
page.off('loaded', onLoadedHandler);
//profiling.stop('application-start');
console.log('Page loaded');
//profiling.start('ng-bootstrap');
console.log('BOOTSTRAPPING TEST APPS...');
//bootstrap(MultiPageMain, [NS_ROUTER_PROVIDERS]);
const rootViewProvider = provide(APP_ROOT_VIEW, { useValue: root });
let singlePageHooksLog = new BehaviorSubject([]);
const singlePageHooksLogProvider = provide(HOOKS_LOG, { useValue: singlePageHooksLog });
bootstrap(SinglePageMain, [rootViewProvider, singlePageHooksLogProvider, SinglePageRouterProviders]);
let multiPageHooksLog = new BehaviorSubject([]);
const multiPageHooksLogProvider = provide(HOOKS_LOG, { useValue: multiPageHooksLog });
bootstrap(MultiPageMain, [rootViewProvider, multiPageHooksLogProvider, MultiPageRouterProviders]);
}
page.on('loaded', onLoadedHandler);
return page;
}
示例3: Page
create: (): Page => {
const page = new Page();
page.content = root;
let onLoadedHandler = function(args) {
page.off('loaded', onLoadedHandler);
//profiling.stop('application-start');
console.log('Page loaded');
//profiling.start('ng-bootstrap');
console.log('BOOTSTRAPPING TEST APPS...');
platform.bootstrapModule(SinglePageModule);
platform.bootstrapModule(MultiPageModule);
platform.bootstrapModule(LazyLoadModule);
}
page.on('loaded', onLoadedHandler);
return page;
}
示例4: require
ďťżimport {Page} from "ui/page";
import * as trace from "trace";
import tests = require("../testRunner");
import {Label} from "ui/label";
trace.enable();
trace.addCategories(trace.categories.Test + "," + trace.categories.Error);
let page = new Page();
page.id = "mainPage";
page.on(Page.navigatedToEvent, onNavigatedTo);
function onNavigatedTo(args) {
let label = new Label({ text: "Running non-UI tests..." });
page.content = label
args.object.off(Page.navigatedToEvent, onNavigatedTo);
setTimeout(function () {
tests.runAll();
}, 10);
}
export function createPage() {
return page;
}
示例5: require
ďťżimport {Page} from "ui/page";
import * as trace from "trace";
import tests = require("../testRunner");
trace.enable();
trace.addCategories(trace.categories.Test + "," + trace.categories.Error);
let started = false;
let page = new Page();
page.on(Page.navigatedToEvent, function () {
if (!started) {
started = true;
setTimeout(function () {
tests.runAll();
}, 10);
}
});
export function createPage() {
return page;
}