I have the following main-page.xml
<Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded">
<StackLayout>
<Placeholder id="chartView" creatingView="creatingView" />
</StackLayout>
</Page>
and the following main-page.js
var vmModule = require("./main-view-model");
function pageLoaded(args) {
var page = args.object;
page.bindingContext = vmModule.mainViewModel;
}
function creatingView(args) {
console.log("creatingView is called");
var nativeView = new UILabel();
nativeView.text = "Native";
args.view = nativeView;
}
exports.creatingView = creatingView;
exports.pageLoaded = pageLoaded;
When the id attribute is before the creatingView the handler is never called. If I switch them like that
<Placeholder creatingView="creatingView" id="chartView" /> the handler is called.
I have the following main-page.xml
and the following main-page.js
When the id attribute is before the creatingView the handler is never called. If I switch them like that
<Placeholder creatingView="creatingView" id="chartView" />the handler is called.