Tag:Wang Zi

  • Single step debugging and source code analysis of ngrx store createselector

    Time:2021-10-20

    Source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // selectTotal […]

  • About the OCC API request triggered when the homepage of SAP e-commerce cloud is loaded

    Time:2021-10-20

    When I visited the locally launched SAP Spartacus storefront, I observed a total of 23 OCC API calls in the chrome developer tool: http://localhost:4200/electro… These 23 OCC API calls can be functionally divided into three groups: Group 1: contains a request /occ/v2/electronics-spa/cms/pages?lang=en&curr=USD Cache-Control in request headers: no-cache The value of the client HTTP request cache […]

  • The selector returned by ngrx store createselector performs one-step debugging of fetching logic

    Time:2021-10-16

    Test source code: import { Component } from ‘@angular/core’; import { createSelector } from ‘@ngrx/store’; export interface State { counter1: number; counter2: number; } export const selectCounter1 = (state: State) => state.counter1; export const selectCounter2 = (state: State) => state.counter2; export const selectTotal = createSelector( selectCounter1, selectCounter2, (counter1, counter2) => counter1 + counter2 ); // […]

  • How SAP Spartacus default routing configuration works

    Time:2021-10-15

    The name of the default configuration file is default-routing-config.ts To see where defaultroutingconfig is consumed: Provudeddefaultconfig is a helper function: When will the routingmodule. Forroot method be called? In these two places: base-storefront.module.ts and storefront-foundation.module.ts: Note the type of the parameter returned by the forroot method: modulewithproviders: Because the consumption module of these modules is […]

  • WSL 2 installation incomplete when Windows starts docker desktop

    Time:2021-10-5

    After installing docker desktop for my windows10 operating system, the following prompt window appears after startup: WSL 2 installation is incomplete Installation connection: https://docs.microsoft.com/en… After installing the wsl2 Linux kernel update package for x64 machines, the docker desktop can be started successfully: More Jerry’s original articles are: “Wang Zixi”:

  • This paper introduces a small tool contextmenumanager for windows 10 to clean up the right-click menu and new menu

    Time:2021-9-27

    After using Windows 10 for a period of time, with the increase of software installed on the machine, the contents of right-click menu and new menu become more and more complex. There are many tools for cleaning these two menus on the Internet. After looking around, I found a green software called contextmenumanager, which is […]

  • ABAP 740 new open SQL enhancements

    Time:2021-8-7

    The following open SQL statement looks a little weird, however it could really works in 740. (1) The field name of my structure ty_my_sflight is different from field defined in sflight, so in SQL statement I use the format <field in DB table> AS <field in my own structure> to move the content from DB […]

  • Implementation of SAP smart toolbar’s XML element Report

    Time:2021-8-5

    http://localhost:8080/resourc… Smarttabletoolbar.fragment.xml contains breakoutactions.fragment: http://localhost:8080/resourc… Source code: <core:FragmentDefinition xmlns:template=”http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1″ xmlns=”sap.m” xmlns:core=”sap.ui.core” xmlns:build=”sap.build”> <template:if test=”{= ${tmpEntitySet>EntitySet} === ${parameter>/entitySet} }”> <template:repeat list=”{tmpEntitySet>Actions}” var=”customaction”> <!–all break out actions which are neither determining nor global–> <template:if test=”{= !${customaction>determining} &amp;&amp; !${customaction>global}}”> <Button id=”{parts: [{path: ‘customaction>’}, {path: ‘tabItem>’}], formatter: ‘sap.suite.ui.generic.template.js.AnnotationHelper.getBreakoutActionButtonId’}” enabled=”{parts: [{path: ‘customaction>’}, {path: ‘tabItem>’}], formatter: ‘sap.suite.ui.generic.template.js.AnnotationHelper.getBreakoutActionEnabledKey’}” text=”{customaction>text}” press=”{customaction>press}” type=”Transparent”> <layoutData> […]

  • Use of isplatformbrowser API in SAP Spartacus

    Time:2021-8-4

    The isbrowser API in window ref.ts encapsulates the angular standard API, isplatformbrowser: From @ angular / common: isBrowser(): boolean { // TODO(#11133): Remove condition when platformId will be always provided return this.platformId ? isPlatformBrowser(this.platformId) : typeof window !== ‘undefined’; } This is the standard API in @ angular / common: https://angular.io/api/common… After clicking in, you […]

  • Loading logic analysis of SAP ui5 application XML view

    Time:2021-7-31

    Task: analyze the loading logic of SAP ui5 root XML view. Mouse over the initiator column and find the createcontent method of uicomponent.js calling the stack: As you can see, the logic here is to parse the root view definition from manifest.json, and then instantiate the view. Let’s take another look at another SAP ui5 […]

  • How to get the current category information in SAP Spartacus category page

    Time:2021-7-29

    demand https://stackoverflow.com/que… Implementation principle AFAIK, currently we do not have anything similar to CurrentProductService for current category. The current SAP Spartacus standard implementation lacks the support of current productservice for product details pages. Looking at the implementation of CurrentProductService you can see that it is using RoutingService and it’s getRouterState() method (picture 1). After studying […]

  • This paper introduces a visual studio code extension that can highlight any keyword

    Time:2021-7-28

    The name of this extension is todo highlight: It was originally designed to highlight the keywords todo and fixme in the code comments: But I found that it can highlight any keyword specified by the user, which is very flexible. Open the settings in the menu file – > Preferences – > user settings: Use […]