当前位置:网站首页>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 .
边栏推荐
- leetcode刷题:字符串04(颠倒字符串中的单词)
- BN(Batch Normalization) 的理论理解以及在tf.keras中的实际应用和总结
- 关于appium踩坑 :Encountered internal error running command: Error: Cannot verify the signature of (已解决)
- The relationship between the development of cloud computing technology and chip processor
- Leetcode question brushing: String 05 (Sword finger offer 58 - ii. left rotation string)
- 定长内存池
- SAP Commerce Cloud 项目 Spartacus 入门
- VB.net类库——4给屏幕截图,裁剪
- The latest 2022 research review of "continuous learning, CL"
- 传纸条【动态规划】
猜你喜欢

Leetcode: hash table 08 (sum of four numbers)

大家都能看得懂的源码(一)ahooks 整体架构篇

In 2022, where will the medium and light-weight games go?

VB.net类库(进阶版——1)

leetcode刷题:字符串06(实现 strStr())

Muke 8. Service fault tolerance Sentinel

windows系統下怎麼安裝mysql8.0數據庫?(圖文教程)

The importance of using fonts correctly in DataWindow

【protobuf 】protobuf 昇級後帶來的一些坑

Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
随机推荐
GameFi 活跃用户、交易量、融资额、新项目持续性下滑,Axie、StepN 能摆脱死亡螺旋吗?链游路在何方?
Android IO, a first-line Internet manufacturer, is a collection of real questions for senior Android interviews
The relationship between the development of cloud computing technology and chip processor
Treasure and niche cover PBR multi-channel mapping material website sharing
宝藏又小众的覆盖物PBR多通道贴图素材网站分享
【protobuf 】protobuf 升级后带来的一些坑
基于启发式搜索的一字棋
Sword finger offer II 098 Number of paths / Sword finger offer II 099 Sum of minimum paths
[Bayesian classification 2] naive Bayesian classifier
Leetcode(763)——划分字母区间
茂莱光学科创板上市:拟募资4亿 范一与范浩兄弟为实控人
【贝叶斯分类4】贝叶斯网
中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
[protobuf] some pits brought by protobuf upgrade
花店橱窗布置【动态规划】
Android mediacodec hard coded H264 file (four), ByteDance Android interview
Muke 8. Service fault tolerance Sentinel
Matrix calculator design for beginners of linear algebra based on Qt development
财务费用分析怎么分析
Distributed ID generation system