SAP Spartacus cms.service.ts getComponentData
在cms.service.ts的getComponentData函数尾部加上subscribe方法打印取回的Componentdata:
/*** Get CMS component data by uid** This method can be safely and optimally used to load multiple components data at the same time.* Calling getComponentData multiple times for different components will always result in optimized* back-end request: all components requested at the same time (in one event loop) will be loaded in one network call.** In case the component data is not present, the method will load it.* Otherwise, if the page context is not provided, the current page context from the router state will be used instead.** @param uid CMS component uid* @param pageContext if provided, it will be used to lookup the component data.*/getComponentData<T extends CmsComponent | null>(uid: string,pageContext?: PageContext): Observable<T> {const context = serializePageContext(pageContext, true);if (!this.components[uid]) {// create the component data structure, if it doesn't already existthis.components[uid] = {};}const component = this.components[uid];if (!component[context]) {// create the component data and assign it to the component's contextcomponent[context] = this.createComponentData(uid, pageContext);}const result = component[context] as Observable<T>;console.log('Jerry in getComponentData method, uid: ' + uid);result.subscribe((data) => {console.log('Jerry got cp data: ' + JSON.stringify(data));});return result;}
Jerry in getComponentData method, uid: HamburgerMenuComponent
在下图这里这个自定义指令cx-component-wrapper发起的对某Component的读取请求:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
SAP Spartacus cms.service.ts getComponentData相关推荐
- SAP Spartacus cms service取完page信息后的回调callback
看这个请求: url: https://s-dev0.eastus.cloudapp.azure.com:9002/occ/v2/electronics-spa/cms/pages?fields=DE ...
- SAP Spartacus cms-components.service.ts里的config.cmsComponents
// we use defer, to be sure the logic below used to compose final observable// will be executed at s ...
- SAP Spartacus config-initializer.service.ts get isStable属性失败的调试
getStableConfig(-scopes: string[]) 注意中间这几层奇怪的callstack: this.unstable = undefined; 这里看不到取数逻辑呢? 语义是:仅 ...
- SAP Spartacus auth.service.ts里的user调用触发的源代码位置
返回类型是一个subscription. Represents a disposable resource, such as the execution of an Observable. subsc ...
- SAP Spartacus CMS 页面加载逻辑和性能的优化
https://github.com/SAP/spartacus/issues/3649 SAP Commerce Cloud CMS 页面加载的一些优化点: Payload of the CMS p ...
- SAP Spartacus CMS Component的lazy loading懒加载方式
代码如下: ConfigModule.withConfig({cmsComponents: {SimpleResponsiveBannerComponent: {component: () => ...
- SAP Spartacus cost-center.config.ts里定义的路由常量,是如何被加载的
文件地址:feature-libs\organization\administration\components\cost-center\cost-center.config.ts module id ...
- 如何修改 SAP Spartacus CMS API 默认的 endpoint
修改 Spartacus-configuration.module.ts 文件里的 occ 配置对象:例如在 cms 前缀后面加上1: import { NgModule } from '@angul ...
- SAP Spartacus checkout.reducer.ts调用时间点
输出: Jerry reducer action type: @ngrx/store/update-reducers 10:38:18.845 checkout.reducer.ts:25 Jerry ...
最新文章
- (Java)程序员应打破牢笼,展望更高层次的世界
- Linux质数合数的脚本,python输出100以内的质数与合数实例代码
- php 获取动态时间,PHP 显示动态时间
- 全新ARM base PocketPC 2003 Emulator Beta 已登場。
- 请解释一下Java多线程回调是什么意思?
- 乐鑫代理-启明云端分享|乐鑫ESP8266模组ESP-WROOM-02D和ESP-WROOM-02U有什么不同
- ASP.NET MVC 4 (十) 模型验证
- %date:~0,10%用法
- eclipse插件安装方法
- 4位16色灰度图像处理
- python列表split_Python-split()函数实例用法讲解
- 鲜花海报,文字与花儿碰上的时候,美妙
- python在统计中的应用_Python在简单数据统计中的应用--随笔记
- 最新版本elasticsearch本地搭建入门篇
- 头颅ct有伪影_颅脑CT怎么看?正常和异常影像分别是什么?干货满满!
- 网上书店系统活动设计
- 【软件工程】软件需求说明书、概要设计说明书、详细设计说明书参考模板
- Ubuntu 20.04安装搜狗输入法(图文详解)
- ireport 实现动态合并单元格
- 云计算:程序员重回个人英雄时代
热门文章
- LINUX安装ORACLE 9204 报错解决!!
- zookeeper配置
- 透过【百度地图API】分析双闭包问题
- SCA/SDO与WCF的比较
- 生成Apk遇到的问题
- 1.4 面向对象的基本概念
- 求极大子矩阵的两种方法
- 微信小程序项目实战知识点总结(swiper组件自适应高度,自定义弹出层,悬浮按钮,虚拟键盘)...
- nth_element(a+1 , a + m, a + n+1);
- ASP.NET图片上传(配合jquery.from.js 插件)