File

projects/storefrontlib/cms-structure/outlet/outlet-ref/outlet-ref.directive.ts

Implements

OnInit OnDestroy

Metadata

Selector [cxOutletRef]

Index

Properties
Methods
Inputs

Constructor

constructor(tpl: TemplateRef, outletService: OutletService)
Parameters :
Name Type Optional
tpl TemplateRef<any> No
outletService OutletService No

Inputs

cxOutletPos
Type : OutletPosition
cxOutletRef
Type : string

Methods

ngOnDestroy
ngOnDestroy()
Returns : void
ngOnInit
ngOnInit()
Returns : void

Properties

cxOutletPos
Type : OutletPosition
Decorators :
@Input()
cxOutletRef
Type : string
Decorators :
@Input()
import {
  Directive,
  Input,
  OnDestroy,
  OnInit,
  TemplateRef,
} from '@angular/core';
import { OutletPosition } from '../outlet.model';
import { OutletService } from '../outlet.service';

@Directive({
  selector: '[cxOutletRef]',
})
export class OutletRefDirective implements OnInit, OnDestroy {
  @Input()
  cxOutletRef: string;
  @Input()
  cxOutletPos: OutletPosition;

  constructor(
    private tpl: TemplateRef<any>,
    private outletService: OutletService
  ) {}

  ngOnInit() {
    this.outletService.add(this.cxOutletRef, this.tpl, this.cxOutletPos);
  }

  ngOnDestroy() {
    this.outletService.remove(this.cxOutletRef, this.cxOutletPos, this.tpl);
  }
}

result-matching ""

    No results matching ""