-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added everything for Step 3: Create Property Binding
- Loading branch information
Showing
2 changed files
with
21 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
sap.ui.define([ | ||
"com/mrb/UI5-Data-Binding/controller/BaseController", | ||
"sap/ui/model/json/JSONModel" | ||
], function(BaseController, JSONModel) { | ||
"use strict"; | ||
sap.ui.define( | ||
[ | ||
"com/mrb/UI5-Data-Binding/controller/BaseController", | ||
"sap/ui/model/json/JSONModel", | ||
], | ||
function (BaseController, JSONModel) { | ||
"use strict"; | ||
|
||
return BaseController.extend("com.mrb.UI5-Data-Binding.controller.Home", { | ||
onInit: function(){ | ||
|
||
var oModel = new JSONModel({ | ||
greetingText: "Hi, my name is Marco" | ||
}); | ||
return BaseController.extend("com.mrb.UI5-Data-Binding.controller.Home", { | ||
onInit: function () { | ||
var oModel = new JSONModel({ | ||
greetingText: "Hi, my name is Marco", | ||
}); | ||
|
||
//Set model globally for all Views/Controls (Dirty) | ||
sap.ui.getCore().setModel(oModel); | ||
} | ||
}); | ||
}); | ||
//Set model globally for all views/controls (dirty) "sap.ui.getCore().setModel(oModel);"" | ||
//the go-to way for global definition would be to define the model within the manifest.json-file | ||
//and retrieve it via "this.getOwnerComponent().getModel();" | ||
this.getView().setModel(oModel); | ||
}, | ||
}); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters