当前位置:网站首页>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刷题:哈希表08 (四数之和)
- The relationship between the development of cloud computing technology and chip processor
- 第2章 构建自定义语料库
- DAST black box vulnerability scanner part 5: vulnerability scanning engine and service capability
- Is there any risk in registering and opening an account for stock speculation? Is it safe?
- 宝藏又小众的覆盖物PBR多通道贴图素材网站分享
- 【 protobuf 】 quelques puits causés par la mise à niveau de protobuf
- C language 99 multiplication table
- 基于QT开发的线性代数初学者的矩阵计算器设计
- 协同过滤进化版本NeuralCF及tensorflow2实现
猜你喜欢

Simple Lianliankan games based on QT

GEE:计算image区域内像素最大最小值

与 MySQL 建立连接

Background search, how to find the website background

后台查找,如何查找网站后台

What are the accounting elements

Establish a connection with MySQL

Gee: calculate the maximum and minimum values of pixels in the image area

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

Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
随机推荐
大家都能看得懂的源码(一)ahooks 整体架构篇
网易云信正式加入中国医学装备协会智慧医院分会,为全国智慧医院建设加速...
众多碎石3d材质贴图素材一键即可获取
第2章 构建自定义语料库
QT环境下配置Assimp库(MinGW编译器)
What are the accounting elements
[Bayesian classification 2] naive Bayesian classifier
[most detailed] the latest and complete redis interview (70)
【连载】说透运维监控系统01-监控系统概述
记录一次Redis大Key的排查
会计要素包括哪些内容
Stop being a giant baby
卷积神经网络(CNN)详解及TensorFlow2代码实现
C language 99 multiplication table
Comment installer la base de données MySQL 8.0 sous Windows? (tutoriel graphique)
VB.net类库,获取屏幕内鼠标下的颜色(进阶——3)
The latest 2022 research review of "continuous learning, CL"
Mr. Sun's version of JDBC (21:34:25, June 12, 2022)
Matrix calculator design for beginners of linear algebra based on Qt development
Leetcode(452)——用最少数量的箭引爆气球