To ensure sap.ui.core.UIComponent
to be created fully asynchronously, we need to implement the IAsyncContentCreation
interface:
metadata: {
interfaces: [
"sap.ui.core.IAsyncContentCreation"
],
manifest: "json"
}
That's totally OK.
Exploring the SAP apps samples, I've found out the following code snippet, where the hard-coded and, thus error prone, interface name is replaced with code, which can be automatically checked:
sap.ui.define([
"sap/ui/core/library",
"sap/ui/core/UIComponent",
…
], function(library, UIComponent, models, History) {
"use strict";
return UIComponent.extend("sap.ui.demo.toolpageapp.Component", {
metadata: {
interfaces: [
library.IAsyncContentCreation
],
manifest: "json"
}
…
}
}
I've tried to check the content of library
in DevTools, but I get a ReferenceError
exception instead of the library
's values:
Uncaught ReferenceError: library is not defined
at eval (eval at init (Component.js:24), <anonymous>:1:1)
at f.init (Component.js:24)
at sap-ui-core.js:315
at f.constructor (sap-ui-core.js:315)
at f.constructor (sap-ui-core.js:585)
at f.constructor (library-preload.js:1154)
at f [as constructor] (sap-ui-core.js:547)
at new o1 (sap-ui-core.js:632)
at H (sap-ui-core.js:628)
at sap-ui-core.js:628
How can I ensure that library.IAsyncContentCreation
is really properly defined and returns "sap.ui.core.IAsyncContentCreation"
as intended?