File

projects/storefrontlib/cms-components/anonymous-consent-management/open-dialog/anonymous-consent-open-dialog.component.ts

Metadata

selector cx-anonymous-consent-open-dialog
templateUrl ./anonymous-consent-open-dialog.component.html

Index

Properties
Methods

Constructor

constructor(vcr: ViewContainerRef, launchDialogService: LaunchDialogService)
Parameters :
Name Type Optional
vcr ViewContainerRef No
launchDialogService LaunchDialogService No

Methods

openDialog
openDialog()
Returns : void

Properties

openElement
Type : ElementRef
Decorators :
@ViewChild('open')
import {
  Component,
  ElementRef,
  ViewChild,
  ViewContainerRef,
} from '@angular/core';
import { LaunchDialogService } from '../../../layout/launch-dialog/services/launch-dialog.service';
import { LAUNCH_CALLER } from '../../../layout/launch-dialog/config/launch-config';
import { take } from 'rxjs/operators';

@Component({
  selector: 'cx-anonymous-consent-open-dialog',
  templateUrl: './anonymous-consent-open-dialog.component.html',
})
export class AnonymousConsentOpenDialogComponent {
  @ViewChild('open') openElement: ElementRef;

  constructor(
    protected vcr: ViewContainerRef,
    protected launchDialogService: LaunchDialogService
  ) {}

  openDialog(): void {
    const dialog = this.launchDialogService.openDialog(
      LAUNCH_CALLER.ANONYMOUS_CONSENT,
      this.openElement,
      this.vcr
    );
    if (dialog) {
      dialog.pipe(take(1)).subscribe();
    }
  }
}
<button #open class="btn btn-link" (click)="openDialog()">
  {{ 'anonymousConsents.preferences' | cxTranslate }}
</button>
Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""