SAP Fiori Elements 应用里的 Title 显示的内容是从哪里来的

仅从静态代码分析来看,title 数据源有两处:

  1. flpSandbox.html 里的 title 标签

  1. manifest.json 文件里 sap.app 字段下的 title 字段。

下图这个语法并不是 Angular 里数据绑定的 interpolation,而是引用了 i18n.properties 文件里的同名属性。

在这里插入图片描述

i18n.properties 文件里的 appTitle place holder(占位符):

运行时发现,应用程序 bootstrap 时,首先显示 html 里维护的值:

最终被 i18n.properties 里的 appTitle 的值所取代。

在函数 fnSetTitleForComponent 里,给 Component 设置 title 属性:

从下面这个函数,能看出 title 属性来自 manifest.json 文件:

	function getAppTitle(){
			return oNavigationControllerProxy.oAppComponent.getManifestEntry("sap.app").title;
		}

更多Jerry的原创文章,尽在:"汪子熙":

原文地址:https://www.cnblogs.com/sap-jerry/p/14713569.html