简体   繁体   中英

Use manifest.json in controllers and views (sapui5)

Is it possible to use some config parameters from the manifest.json in a view or controller within sapui5?

Eg in my Component.js I can write smth like:

console.log(this.getMetadata().getManifestEntry("sap.app"));

I would like to access the ManifestEntry from my detail view ( JS ) because I specified the name of my model in the manifest. Until now I call my model in the view directly with:

this.getModel("dummyModel")

But I believe it would be better to call it indirectly so I don't have to change the string everywhere in case I wanna change the model name. Eg:

this.getModel(PLEASEHELP.getManifestEntry("sap.app").myModel);

您可以通过getOwnerComponent()从控制器访问组件:

this.getOwnerComponent().getManifestEntry("sap.app").myModel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM