Hello, please tell me how to do it correctly? I’m trying to execute a function at startup, with local data JSON everything works, when trying to work with data from firebase it doesn’t, but if I call this function, for example, from a button after loading the project, then with firebase everything works
import Felgo
import QtQuick
App {
AppPage {
id: page
readonly property var dataSource1: fireBaseDataModel.shoppingItems1 || {}
// property with json data
property var jsonData: [
{
“id”: 1,
“title”: “Entry 1”
},
{
“id”: 2,
“title”: “Entry 2”
},
{
“id”: 3,
“title”: “Entry 3”
}
]
// list model for json data
JsonListModel {
id: jsonModel
source: page.jsonData // dataSource1 – model from FireBase
keyField: “id”
function prepare(){
jsonModel.setProperty(0,”title”,”Hello”)
}
}
// list view
AppListView {
anchors.fill: parent
model: jsonModel
delegate: SimpleRow {
text: model.title
}
}
Component.onCompleted: jsonModel.prepare()
}
}