Skip to content

Commit 24e6a13

Browse files
committed
Added everything for Step 2: Creating a Model
1 parent 2498fd3 commit 24e6a13

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
sap.ui.define([
2-
"com/mrb/UI5-Data-Binding/controller/BaseController"
3-
], function(Controller) {
2+
"com/mrb/UI5-Data-Binding/controller/BaseController",
3+
"sap/ui/model/json/JSONModel"
4+
], function(BaseController, JSONModel) {
45
"use strict";
56

6-
return Controller.extend("com.mrb.UI5-Data-Binding.controller.Home", {});
7+
return BaseController.extend("com.mrb.UI5-Data-Binding.controller.Home", {
8+
onInit: function(){
9+
10+
var oModel = new JSONModel({
11+
greetingText: "Hi, my name is Marco"
12+
});
13+
14+
//Set model globally for all Views/Controls (Dirty)
15+
sap.ui.getCore().setModel(oModel);
16+
}
17+
});
718
});

0 commit comments

Comments
 (0)