From 257a5616e50632ec9589f94b98a3710a3acd5e89 Mon Sep 17 00:00:00 2001 From: Mio Yasutake Date: Sun, 12 Jun 2022 06:14:42 +0900 Subject: [PATCH 1/5] week1 test --- webapp/controller/Main.controller.js | 25 +++++++++++++++++++++++++ webapp/index.html | 2 +- webapp/manifest.json | 15 +++++++++++++-- webapp/view/Main.view.xml | 22 ++++++++++++++++++++++ 4 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 webapp/controller/Main.controller.js create mode 100644 webapp/view/Main.view.xml diff --git a/webapp/controller/Main.controller.js b/webapp/controller/Main.controller.js new file mode 100644 index 0000000..ad903b7 --- /dev/null +++ b/webapp/controller/Main.controller.js @@ -0,0 +1,25 @@ +sap.ui.define([ + "./BaseController", + "sap/ui/model/json/JSONModel" +], function (BaseController, JSONModel) { + "use strict"; + + return BaseController.extend("ui5.challenge.controller.Main", { + onInit: function () { + let model = { + items : [{ + title: "First Item", + counter: 1 + },{ + title: "Secone Item", + counter: 2 + },{ + title: "Third Item", + counter: 1 + }] + } + this.getView().setModel(new JSONModel(model), "viewModel") + } + + }); +}); diff --git a/webapp/index.html b/webapp/index.html index 01c1bb6..f3ea286 100644 --- a/webapp/index.html +++ b/webapp/index.html @@ -1,7 +1,7 @@ - title + ui5-challenge