如何添加新的 occ 端点参数以获得 url?

How to add new occ endpoints paramater to get url?

我正在引用 defaultOccProductConfig 并希望添加新端点以动态获取 url。

例如;

productReviews: 'products/${productCode}/reviews', // this is existing endpoint
productManipulation: 'products/${productCode}/manipulation' // this is what i want to add

在导入模块后添加此端点时出现错误。我如何覆盖我的新端点?

在您的结节(即应用程序模块)中,请通过导入 ConfigModule.withConfig() 提供您的自定义配置块。例如:

@NgModule({
  imports: [
    /* ... */
    ConfigModule.withConfig({
      backend: {
        occ: {
          endpoints: {
            productManipulation: 'products/${productCode}/manipulation' // this is what i want to add
          }
        }
      }
    })
    /* ... */
  ]
})
export class AppModule {};

有关更多信息,请参阅文档: