mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 22:01:42 +08:00

# Conflicts: # apps/automated/src/test-runner.ts # apps/automated/src/ui/bottom-navigation/bottom-navigation-navigation-tests.ts # apps/ui/src/bottom-navigation/events-page.ts # apps/ui/src/main-page.ts # apps/ui/src/test-page-main-view-model.ts # package.json # packages/core/color/color-common.ts # packages/core/color/index.d.ts # packages/core/ui/action-bar/index.android.ts # packages/core/ui/bottom-navigation/index.android.ts # packages/core/ui/core/view/index.ios.ts # packages/core/ui/core/view/view-helper/view-helper-common.ts # packages/core/ui/index.ts # packages/core/ui/styling/background.android.ts # packages/core/ui/tab-navigation-base/tab-strip-item/index.ts # packages/webpack/jasmine-config/reporter.ts
Use the frame in the following way:
To navigate to the starting page of the application
// put this in the bootstrap.js
var app = require("application");
var frameModule = require("ui/frame");
app.onLaunch = function(context) {
var frame = new frameModule.Frame();
frame.navigate("testPage");
}
// or use the mainModule property of the application module
// in this a Frame instance is internally created and used to navigate to the main page module
app.mainModule = "testPage";
To navigate to a new Page
// take the frame from an existing (and navigatedTo) Page instance
var frame = page.frame;
frame.navigate("newPage");
To navigate to a new Activity (Android)
// create a new Frame instance
var frameModule = require("ui/frame");
var frame = new frameModule.Frame();
frame.navigate("newPage");