projects/storefrontlib/cms-structure/outlet/outlet-ref/outlet-ref.directive.ts
| Selector | [cxOutletRef] |
Properties |
Methods |
Inputs |
constructor(tpl: TemplateRef
|
|||||||||
|
Parameters :
|
| cxOutletPos | |
Type : OutletPosition
|
|
| cxOutletRef | |
Type : string
|
|
| ngOnDestroy |
ngOnDestroy()
|
|
Returns :
void
|
| ngOnInit |
ngOnInit()
|
|
Returns :
void
|
| 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);
}
}