File

projects/rebirth-ng/src/lib/popover/popover.directive.ts

Metadata

selector [rePopover]

Index

Methods
Inputs

Constructor

constructor(viewContainerRef: ViewContainerRef, elementRef: ElementRef, componentFactoryResolver: ComponentFactoryResolver, injector: Injector, positionService: PositionService, renderer: Renderer2, rebirthNGConfig: RebirthNGConfig)
Parameters :
Name Type Optional
viewContainerRef ViewContainerRef no
elementRef ElementRef no
componentFactoryResolver ComponentFactoryResolver no
injector Injector no
positionService PositionService no
renderer Renderer2 no
rebirthNGConfig RebirthNGConfig no

Inputs

rePopover

Type: string | TemplateRef<any>

reTitle

Type: string | TemplateRef<any>

Methods

Protected fillPopup
fillPopup()
getContent
getContent()
Returns : string | TemplateRef
import {
  Directive,
  Input,
  TemplateRef,
  ViewContainerRef,
  ElementRef,
  ComponentFactoryResolver,
  Injector,
  Renderer2
} from '@angular/core';
import { PopoverPopupComponent } from './popover-popup.component';
import { PositionService } from '../position/positioning.service';
import { Tooltip } from '../tooltip/tooltip';
import { RebirthNGConfig } from '../rebirth-ng.config';

@Directive({
  selector: '[rePopover]',
  exportAs: 'popover'
})
export class PopoverDirective extends Tooltip<PopoverPopupComponent> {
  @Input('reTitle') title: string | TemplateRef<any>;
  @Input('rePopover') content: string | TemplateRef<any>;

  constructor(viewContainerRef: ViewContainerRef,
              elementRef: ElementRef,
              componentFactoryResolver: ComponentFactoryResolver,
              injector: Injector,
              positionService: PositionService,
              renderer: Renderer2,
              rebirthNGConfig: RebirthNGConfig) {
    super(viewContainerRef, elementRef, componentFactoryResolver, injector, positionService, renderer, rebirthNGConfig);
    this.tooltipPopupType = PopoverPopupComponent;
    this.trigger = 'click';
  }

  protected fillPopup(): PopoverPopupComponent {
    const popupComponent = super.fillPopup();
    popupComponent.title = this.title;
    return popupComponent;
  }

  getContent(): string | TemplateRef<any> {
    return this.content;
  }

}

results matching ""

    No results matching ""