当前位置:网站首页>How SAP Spartacus default routing configuration works
How SAP Spartacus default routing configuration works
2022-06-26 21:29:00 【Hua Weiyun】
The name of the default configuration file :default-routing-config.ts

Check where you spent defaultRoutingConfig:

provudeDefaultConfig It's a helper function :

This RoutingModule.forRoot When will the method be called ?

In these two places :base-storefront.module.ts and storefront-foundation.module.ts:

Be careful forRoot Method returns the type of the parameter :ModuleWithProviders:
because import these module Consumption module,imports The type of area is any[] | Type<any> | ModuleWithProviders<{}>)[]


About ValueProvider Description of each parameter :

provide: Inject token . Usually Type or InjectionToken Example , But it can also be any example .
multi: If true, Then the injector returns the instance array . This is useful for allowing multiple providers to spread across multiple files to provide configuration information to public tokens .
An example :
const locale = new InjectionToken<string[]>('locale');const injector = Injector.create({ providers: [ {provide: locale, multi: true, useValue: 'en'}, {provide: locale, multi: true, useValue: 'sk'}, ]});const locales: string[] = injector.get(locale);expect(locales).toEqual(['en', 'sk']);ModuleWithProviders: Yes NgModule And related providers Packaging .
边栏推荐
- Icml2022 | neurotoxin: a lasting back door to federal learning
- Student information management system based on SSH Framework
- 基于启发式搜索的一字棋
- leetcode刷题:字符串06(实现 strStr())
- Leetcode question brushing: String 03 (Sword finger offer 05. replace space)
- 【山东大学】考研初试复试资料分享
- 在哪家证券公司开户最方便最安全可靠
- DLA模型(分类模型+改进版分割模型) + 可变形卷积
- VB.net类库——4给屏幕截图,裁剪
- 不要做巨嬰了
猜你喜欢

The postgraduate entrance examination in these areas is crazy! Which area has the largest number of candidates?

会计要素包括哪些内容

Listing of maolaiguang discipline on the Innovation Board: it is planned to raise 400million yuan. Fanyi and fanhao brothers are the actual controllers

Simple Lianliankan games based on QT

Leetcode(763)——划分字母区间

矩阵求导及其链式法则

花店橱窗布置【动态规划】

leetcode刷题:哈希表08 (四数之和)

The relationship between the development of cloud computing technology and chip processor

【连载】说透运维监控系统01-监控系统概述
随机推荐
Muke 11. User authentication and authorization of microservices
QT based "synthetic watermelon" game
Arrête d'être un bébé géant.
[protobuf] some pits brought by protobuf upgrade
SentinelResource注解詳解
y48.第三章 Kubernetes从入门到精通 -- Pod的状态和探针(二一)
Fixed length memory pool
【贝叶斯分类4】贝叶斯网
众多碎石3d材质贴图素材一键即可获取
茂莱光学科创板上市:拟募资4亿 范一与范浩兄弟为实控人
YuMinHong: New Oriental does not have a reversal of falling and turning over, destroying and rising again
后台查找,如何查找网站后台
Gee: calculate the maximum and minimum values of pixels in the image area
剑指 Offer II 098. 路径的数目 / 剑指 Offer II 099. 最小路径之和
KDD2022 | 基于知识增强提示学习的统一会话推荐系统
Dynamic parameter association using postman
[most detailed] latest and complete redis interview (42 tracks)
The postgraduate entrance examination in these areas is crazy! Which area has the largest number of candidates?
0 basic C language (3)
手机股票注册开户有没有什么风险?安全吗?