-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComponent.js
More file actions
34 lines (28 loc) · 1004 Bytes
/
Component.js
File metadata and controls
34 lines (28 loc) · 1004 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
jQuery.sap.declare("sap.ui.demo.myFiori2.Component");
sap.ui.core.UIComponent.extend("sap.ui.demo.myFiori2.Component", {
createContent : function() {
// create root view
var oView = sap.ui.view({
id : "app",
viewName : "sap.ui.demo.myFiori2.view.App",
type : "JS",
viewData : { component : this }
});
// set i18n model
var i18nModel = new sap.ui.model.resource.ResourceModel({
bundleUrl : "i18n/messageBundle.properties"
});
oView.setModel(i18nModel, "i18n");
// // Using OData model to connect against a real service
// var url = "/proxy/http/<server>:<port>/sap/opu/odata/sap/ZGWSAMPLE_SRV/";
// var oModel = new sap.ui.model.odata.ODataModel(url, true, "<user>", "<password>");
// oView.setModel(oModel);
// Using a local model for offline development
var oModel = new sap.ui.model.json.JSONModel("model/styles.json");
oView.setModel(oModel);
var db = new PouchDB('PLMDB');
var remoteCouch = false;
// done
return oView;
}
});