File

projects/storefrontlib/cms-components/navigation/category-navigation/category-navigation.component.ts

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector cx-category-navigation
templateUrl ./category-navigation.component.html

Index

Properties

Constructor

constructor(componentData: CmsComponentData<CmsNavigationComponent>, service: NavigationService)
Parameters :
Name Type Optional
componentData CmsComponentData<CmsNavigationComponent> No
service NavigationService No

Properties

data$
Type : Observable<CmsNavigationComponent>
Default value : this.componentData.data$
node$
Type : Observable<NavigationNode>
Default value : this.service.getNavigationNode( this.componentData.data$ )
import { ChangeDetectionStrategy, Component } from '@angular/core';
import { CmsNavigationComponent } from '@spartacus/core';
import { Observable } from 'rxjs';
import { CmsComponentData } from '../../../cms-structure/page/model/cms-component-data';
import { NavigationNode } from '../navigation/navigation-node.model';
import { NavigationService } from '../navigation/navigation.service';

@Component({
  selector: 'cx-category-navigation',
  templateUrl: './category-navigation.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class CategoryNavigationComponent {
  node$: Observable<NavigationNode> = this.service.getNavigationNode(
    this.componentData.data$
  );

  data$: Observable<CmsNavigationComponent> = this.componentData.data$;

  constructor(
    protected componentData: CmsComponentData<CmsNavigationComponent>,
    protected service: NavigationService
  ) {}
}
<cx-navigation-ui
  *ngIf="data$ | async as data"
  [node]="node$ | async"
  [ngClass]="data.styleClass"
  [wrapAfter]="data.wrapAfter"
  [resetMenuOnClose]="data.resetMenuOnClose"
></cx-navigation-ui>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""