mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
* fix: clear the `resolvedPage` when entry is being cleared fix: change the passed `View` to be a weak reference * chore: add trace logs when weak ref has been cleared but is continuing to be used chore: add condition to check if weak ref has not been cleared when it is being used * chore: refactor the way the `resolvedPage` is cleared * chore: add backward compatible property to avoid breaking changes * chore: refactor condition to check if WeakRef is not cleared chore: add tracelogs * chore: refactor condition to check if WeakRef is not cleared chore: add tracelogs * refactor: weakRef usages * chore: change the way WeakRef type check is done
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");