[WUC] The good old new
by Arnaud Buchholz
HTML
<a target="_blank" href="https://sapui5.hana.ondemand.com/#docs/api/symbols/sap.ui.html#.view">sap.ui.view</a><hr>
CSS
.title {
font-size: 24pt;
color: orange;
text-decoration: underline;
}
.section {
font-size: 18pt;
color: orange;
padding-top: 16px;
}
.context {
color: gray;
}
JavaScript
function log (oText) {
var sText;
if ("object" === typeof oText) {
sText = JSON.stringify(oText);
} else {
sText = oText.toString();
}
var oLine = document.createElement("div");
oLine.appendChild(document.createTextNode(sText));
return document.body.appendChild(oLine);
}
log("The good old new").className = "title";
var sap = {
ui: {
view: function () {
return {
property: "value"
};
}
}
};
log("With new").className = "section";
var oWithNew = new sap.ui.view();
log(oWithNew);
log("Without new").className = "section";
var oWithoutNew = sap.ui.view();
log(oWithoutNew);