Skip to content

Instantly share code, notes, and snippets.

@themasch
Created July 16, 2014 10:02
Show Gist options
  • Save themasch/c40726f1f48cd8cce5e9 to your computer and use it in GitHub Desktop.
Save themasch/c40726f1f48cd8cce5e9 to your computer and use it in GitHub Desktop.
inline xmlviews in ui5 component-preload.js
!(function() {
if (!sap.ui.core.mvc.View.prototype_initCompositeSupport) {
try {
sap.ui.core.mvc.View();
} catch (x) {} ;
}
var p = sap.ui.core.mvc.View.prototype, oI = p._initCompositeSupport;
p._initCompositeSupport = function(s) {
if (s.viewName) {
var vT = {"view.App": "<mvc:View xmlns=\"sap.m\" xmlns:mvc=\"sap.ui.core.mvc\" displayBlock=\"true\"> <Shell appWidthLimited=\"true\"> <App id=\"rootNav\"/> </Shell> </mvc:View>" /* ... */};
if (vT[s.viewName]) {
s.viewContent = vT[s.viewName];
delete s.viewName;
}
}
oI.apply(this, arguments);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment