File

projects/wvr-elements/src/lib/wvr-manifest/wvr-manifest-entry/wvr-manifest-entry.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(eRef: ElementRef, componentRegistry: ComponentRegistryService<WvrBaseComponent>)
Parameters :
Name Type Optional
eRef ElementRef<HTMLElement> No
componentRegistry ComponentRegistryService<WvrBaseComponent> No

Inputs

description
Type : any
mappingStrategy
Type : any
methods
Type : any
name
Type : any
options
Type : any
path
Type : any

Methods

ngOnInit
ngOnInit()
Returns : void

Properties

Private parent
Type : WvrManifestComponent
import { ChangeDetectionStrategy, Component, ElementRef, Input, OnInit } from '@angular/core';
import { ComponentRegistryService } from '../../core/component-registry.service';
import { WvrBaseComponent } from '../../shared/wvr-base.component';
import { WvrManifestComponent } from '../wvr-manifest.component';

@Component({
  selector: 'wvr-manifest-entry-component',
  template: '',
  changeDetection: ChangeDetectionStrategy.Default
})
export class WvrManifestEntryComponent implements OnInit {

  @Input() name;

  @Input() description;

  @Input() methods;

  @Input() path;

  @Input() options;

  @Input() mappingStrategy;

  private parent: WvrManifestComponent;

  constructor(
    private readonly eRef: ElementRef<HTMLElement>,
    private readonly componentRegistry: ComponentRegistryService<WvrBaseComponent>
  ) {

  }

  ngOnInit(): void {
    const parentElem = this.eRef.nativeElement.closest('wvre-manifest, wvr-manifest-component');
    if (parentElem) {
      this.parent = this.componentRegistry.getComponentByElement(parentElem as HTMLElement) as WvrManifestComponent;
      this.parent.addEntry(this);
    } else {
      console.warn(`WvrManifestEntryComponent ${this.name} is not contained with a WvrManifestComponent`);
    }
  }

}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""