SAP Spartacus和product相关的标准normalizer
2023-09-14 09:02:55 时间
以product name normalizer为例:
路径:C:\Code\SPA\spartacus\projects\core\src\occ\adapters\product\converters\product-name-normalizer.ts
拷贝下类的名称:
ProductNameNormalizer
如果想运行时调试,在Spartacus-core.js里,根据这个名称搜索,找到对应的JavaScript function:ProductNameNormalizer_Factory:
/**
* Construct an `InjectableDef` which defines how a token will be constructed by the DI system, and
* in which injectors (if any) it will be available.
*
* This should be assigned to a static `ɵprov` field on a type, which will then be an
* `InjectableType`.
*
* Options:
* * `providedIn` determines which injectors will include the injectable, by either associating it
* with an `@NgModule` or other `InjectorType`, or by specifying that this injectable should be
* provided in the `'root'` injector, which will be the application-level injector in most apps.
* * `factory` gives the zero argument function which will create an instance of the injectable.
* The factory can call `inject` to access the `Injector` and request injection of dependencies.
*
* @codeGenApi
*/
function ɵɵdefineInjectable(opts) {
return {
token: opts.token,
providedIn: opts.providedIn || null,
factory: opts.factory,
value: undefined,
};
}
随着构造函数一起传进来的配置对象:
这个配置对象的赋值是通过eeinject(OccConfig)进行的:
converter调用的地方:Pipeable operator to apply converter logic in a observable stream
convertSource(source, injectionToken) {
return this.getConverters(injectionToken).reduce((target, converter) => {
return converter.convert(source, target);
}, undefined);
}
向Commerce Cloud后台发起请求:
得到完整的occ地址:
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
相关文章
- [SAA + SAP] 04 ALB + ASG
- SAP UI5 应用开发教程之五十二 - 如何使用 SAP UI5 的标准控件结合 Cordova 插件调用手机摄像头进行条形码扫描试读版
- 使用工具分析 SAP UI5 应用前端执行的性能问题
- 为什么Note.js 里面没有sap.ui.core.Control.extend()这样的代码,但是runtime有自动生成有
- 如何自行查找出 SAP ABAP 标准的 OData 服务返回数据的后台数据库表和表字段名称试读版
- Basic introduction about SAP SPS (Support Package Stack)
- SAP 电商云 Spartacus UI 设置 delivery mode 在 3G 慢速网络下的排队效果
- SAP Spartacus PDP - product detail page 的 CMS 驱动设计方式
- SAP Spartacus focus directive tabindex的默认值设置
- SAP Spartacus里的标准Banner设计
- SAP Spartacus routing parameter mapping介绍
- SAP Cloud for Customer 标准培训课程
- 一个最简单的例子学习SAP Cloud for Customer HTML mashup
- SAP标准培训课程C4C10学习笔记(四)第四单元
- SAP Hybris install.bat工作原理分析
- SAP 产品增强技术一览
- 响应式编程在 SAP 标准产品 UI 开发中的一个实践
- SAP CRM Fiori 标准应用 My Account - search by ID 根据 ID 进行搜索的标准功能实现原理
- 如何定制化SAP Fiori标准应用里UI字段的标签
- SAP ABAP OData 服务如何支持 $filter (过滤)操作试读版
- 35. 如何自行查找出 SAP ABAP 标准的 OData 服务返回数据的后台数据库表和表字段名称
- 24. SAP 标准产品里使用 OData 服务的一些细节分享
- 9. SAP ABAP OData 服务如何支持删除(Delete)操作