File

src/lib/services/pagesRenderer/test/component/parentStub.component.ts

Description

Component used only for testing purposes

Metadata

Index

Properties
Inputs
Accessors

Constructor

constructor(ref: ChangeDetectorRef, renderer2: Renderer2, el: ElementRef)

Creates an instance of ParentStubComponent.

Parameters :
Name Type Optional
ref ChangeDetectorRef No
renderer2 Renderer2 No
el ElementRef No

Inputs

model
Type : any

Sets the component model.

Properties

_model
Type : any

This stores the component model.

displayElement
Type : HTMLElement | undefined

The displayElement variable.

Accessors

model
setmodel(value: any)

Sets the component model.

Parameters :
Name Type Optional
value any No
Returns : void
displayElementPanel
setdisplayElementPanel(value: ElementRef)

Sets the displayElement variable.

Parameters :
Name Type Optional
value ElementRef No
Returns : void
import {
  ChangeDetectionStrategy,
  ChangeDetectorRef,
  Component,
  ElementRef,
  Renderer2,
  ViewChild,
  Input
} from '@angular/core';

/**
 * Component used only for testing purposes
 * @export
 * @class ParentStubComponent
 */
@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'wm-parent',
  styleUrls: ['./parentStub.component.scss'],
  templateUrl: './parentStub.component.html'
})
export class ParentStubComponent {
  /**
   * Creates an instance of ParentStubComponent.
   *
   * @param {ChangeDetectorRef} ref
   * @param {Renderer2} renderer2
   * @param {ElementRef} el
   * @memberof ParentStubComponent
   */
  constructor(
    private ref: ChangeDetectorRef,
    private renderer2: Renderer2,
    private el: ElementRef
  ) {}

  /**
   * The displayElement variable.
   *
   * @type {HTMLElement}
   * @memberof ParentStubComponent
   */
  displayElement: HTMLElement | undefined;

  /**
   * This stores the component model.
   *
   * @type {*}
   * @memberof ParentStubComponent
   */
  _model: any;

  /**
   * Sets the component model.
   *
   * @param {*} value
   * @memberof ParentStubComponent
   */
  @Input()
  set model(value: any) {
    this._model = value;
  }

  /**
   * Sets the displayElement variable.
   *
   * @param {ElementRef} value
   * @memberof ParentStubComponent
   */
  @ViewChild('displayElement', { static: false })
  set displayElementPanel(value: ElementRef) {
    this.displayElement = value != null ? value.nativeElement : null;
  }
}
<div #displayElement class="parentclass"></div>

./parentStub.component.scss

.parentclass{
    border-style: solid;
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""