I have a controller that creates on the onInit
function a model:
return Controller.extend("com.mindustry.SalesStatistics2.controller.Content", {
onInit: function() {
this.getOwnerComponent().setModel(oModel, "PayersSuggestion");
.....
The question is, is the model PayersSuggestion globally defined or only on local?
And what is the difference between
this.getOwnerComponent().setModel(oModel, "PayersSuggestion");
and
this.getView().setModel(oModel, "PayersSuggestion");
When I use the second on the onInit function and for example few lines later I would call
const oPayersModel = this.getView().getModel("PayersSuggestion");
then oPayersModel
would be undefined
.