File

src/lib/fs/cms/page/fs-cms-page.context-factory.ts

Description

This factory creates a context from an Identifier and a PageType.

Index

Methods

Methods

createPageContextFor
createPageContextFor(pageIdentifier: string, pageType: PageType)

This method returns the resulting PageContext.

Parameters :
Name Type Optional Description
pageIdentifier string No

The page's identifier.

pageType PageType No

The page's type.

Returns : PageContext
import { PageContext, PageType } from '@spartacus/core';
import { Injectable } from '@angular/core';

/**
 * This factory creates a context from an Identifier and a PageType.
 */
@Injectable({
  providedIn: 'root',
})
export class FsCmsPageContextFactory {
  /**
   * This method returns the resulting PageContext.
   *
   * @param pageIdentifier The page's identifier.
   * @param pageType The page's type.
   */
  createPageContextFor(pageIdentifier: string, pageType: PageType): PageContext {
    return { id: pageIdentifier, type: pageType };
  }
}

results matching ""

    No results matching ""