Skip to content

Commit

Permalink
Added everything for Step 2: Creating a Model
Browse files Browse the repository at this point in the history
  • Loading branch information
wridgeu committed May 19, 2020
1 parent 2498fd3 commit 24e6a13
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions webapp/controller/Home.controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
sap.ui.define([
"com/mrb/UI5-Data-Binding/controller/BaseController"
], function(Controller) {
"com/mrb/UI5-Data-Binding/controller/BaseController",
"sap/ui/model/json/JSONModel"
], function(BaseController, JSONModel) {
"use strict";

return Controller.extend("com.mrb.UI5-Data-Binding.controller.Home", {});
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);
}
});
});

0 comments on commit 24e6a13

Please sign in to comment.