当前位置:网站首页>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 .
边栏推荐
- The source code that everyone can understand (I) the overall architecture of ahooks
- leetcode刷题:哈希表08 (四数之和)
- Redis + guava local cache API combination, performance burst!
- [LeetCode]-链表-2
- 中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
- [most detailed] the latest and complete redis interview (70)
- PostgreSQL notes
- Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
- Leetcode question brushing: String 06 (implement strstr())
- 12个MySQL慢查询的原因分析
猜你喜欢

【连载】说透运维监控系统01-监控系统概述

Leetcode question brushing: String 02 (reverse string II)

Vi/vim editor

Many gravel 3D material mapping materials can be obtained with one click

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

Leetcode: String 04 (reverse the words in the string)

Establish a connection with MySQL

Y48. Chapter III kubernetes from introduction to mastery -- pod status and probe (21)

How to install mysql8.0 database under Windows system? (Graphic tutorial)

2022年,中轻度游戏出海路在何方?
随机推荐
指南针能开户炒股吗?安全吗?
Two methods of QT to realize timer
十大券商注册开户有没有什么风险?安全吗?
宝藏又小众的覆盖物PBR多通道贴图素材网站分享
C: Reverse linked list
GEE:计算image区域内像素最大最小值
[leetcode]- linked list-2
ICML2022 | Neurotoxin:联邦学习的持久后门
经典Wide & Deep模型介绍及tensorflow 2代码实现
Swagger: how to generate beautiful static document description pages
财务费用分析怎么分析
股票炒股注册开户有没有什么风险?安全吗?
【贝叶斯分类3】半朴素贝叶斯分类器
DLA模型(分类模型+改进版分割模型) + 可变形卷积
Leetcode(452)——用最少数量的箭引爆气球
如何用 SAP BTP 平台上的图形建模器创建一个 OData 服务
中金证券经理给的开户二维码办理股票开户安全吗?我想开个户
基于Qt实现的“合成大西瓜”小游戏
证券注册开户有没有什么风险?安全吗?
JWT operation tool class sharing