Last active
August 21, 2018 17:29
-
-
Save boghyon/f02a2e7237aed5a0b08b3944f6cacd48 to your computer and use it in GitHub Desktop.
UI5 basic template
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
{ | |
window["sap-ui-config"] = { | |
libs: "sap.ui.core, sap.m", | |
preload: "async", | |
theme: "sap_belize", | |
compatVersion: "edge", | |
resourceRoots: { | |
"demo": "./" | |
}, | |
"xx-componentPreload": "off", | |
"xx-waitForTheme": true, | |
"xx-async": true, | |
"xx-xml-processing": "sequential", | |
"xx-supportedLanguages": "", | |
}; | |
} |
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
sap.ui.define([ | |
"sap/ui/core/UIComponent" | |
], function(UIComponent) { | |
"use strict"; | |
return UIComponent.extend("demo.Component", { | |
metadata: { | |
manifest: "json" | |
}, | |
init: function() { | |
UIComponent.prototype.init.apply(this, arguments); | |
this.getRouter().initialize(); | |
}, | |
}); | |
}); |
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
sap.ui.define([ | |
"sap/ui/core/mvc/Controller" | |
], function(Controller) { | |
"use strict"; | |
return Controller.extend("demo.controller.App", { | |
onInit: function() { | |
}, | |
}); | |
}); |
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
sap.ui.define([ | |
"sap/ui/core/mvc/Controller", | |
], function(Controller) { | |
"use strict"; | |
return Controller.extend("demo.controller.Home", { | |
onInit: function() { | |
}, | |
}); | |
}); |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Demo</title> | |
<script src="bootConfig.js"></script> | |
<script src="https://openui5nightly.hana.ondemand.com/resources/sap-ui-core.js" id="sap-ui-bootstrap"></script> | |
<script src="init.js"></script> | |
</head> | |
<body class="sapUiBody" id="content"> | |
</body> | |
</html> |
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
sap.ui.getCore().attachInit(() => sap.ui.component({ | |
name: "demo", // Without `name`, manifest will be loaded twice. | |
manifest: true, | |
}).then(createdComponent => sap.ui.require([ | |
"sap/ui/core/ComponentContainer" | |
], Container => new Container({ | |
component: createdComponent, | |
height: '100%', | |
}).placeAt('content')))); |
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
{ | |
"myData": null | |
} |
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
{ | |
"_version": "1.10.0", | |
"start_url": "index.html", | |
"sap.app": { | |
"id": "demo", | |
"type": "application", | |
"title": "Demo", | |
"description": "Sample Code", | |
"applicationVersion": { | |
"version": "1.0.0" | |
}, | |
"dataSources": { | |
"myDataSource": { | |
"type": "JSON", | |
"uri": "localData/demoData.json" | |
} | |
} | |
}, | |
"sap.ui": { | |
"technology": "UI5", | |
"deviceTypes": { | |
"desktop": true, | |
"tablet": true, | |
"phone": true | |
}, | |
"supportedThemes": [ | |
"sap_belize_hcw", | |
"sap_belize_hcb", | |
"sap_belize", | |
"sap_belize_plus" | |
] | |
}, | |
"sap.ui5": { | |
"dependencies": { | |
"minUI5Version": "1.52.0", | |
"libs": { | |
"sap.ui.core": {}, | |
"sap.m": {} | |
} | |
}, | |
"contentDensities": { | |
"compact": true, | |
"cozy": true | |
}, | |
"resources": { | |
"js": [ | |
], | |
"css": [ | |
] | |
}, | |
"models": { | |
"": { | |
"dataSource": "myDataSource", | |
"preload": true | |
} | |
}, | |
"rootView": { | |
"viewName": "demo.view.App", | |
"id": "rootView", | |
"type": "XML", | |
"async": true | |
}, | |
"routing": { | |
"routes": [{ | |
"name": "home", | |
"pattern": "", | |
"target": "home", | |
"titleTarget": "home" | |
}], | |
"targets": { | |
"home": { | |
"viewId": "homeView", | |
"viewName": "Home", | |
"transition": "fade", | |
"viewLevel": 1 | |
}, | |
"notFound": { | |
"viewName": "Home", | |
"transition": "slide", | |
"viewLevel": 98 | |
} | |
}, | |
"config": { | |
"async": true, | |
"routerClass": "sap.m.routing.Router", | |
"viewType": "XML", | |
"viewPath": "demo.view", | |
"controlId": "rootApp", | |
"controlAggregation": "pages", | |
"transition": "slide", | |
"bypassed": { | |
"target": "notFound" | |
}, | |
"homeRoute": "home" | |
} | |
} | |
} | |
} |
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
<mvc:View | |
xmlns="sap.m" | |
xmlns:mvc="sap.ui.core.mvc" | |
controllerName="demo.controller.App" | |
displayBlock="true" | |
height="100%" | |
> | |
<App id="rootApp"> | |
<pages> | |
<!-- will be added by Router --> | |
</pages> | |
</App> | |
</mvc:View> |
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
<mvc:View | |
xmlns="sap.m" | |
xmlns:mvc="sap.ui.core.mvc" | |
controllerName="demo.controller.Home" | |
> | |
<Page id="homePage" title="Home"> | |
</Page> | |
</mvc:View> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment