File

src/app/streams/stream-deploy/properties-debug/properties-debug.component.ts

Description

Component used to display parameters of a stream deployment

Implements

OnChanges

Example

Metadata

changeDetection ChangeDetectionStrategy.OnPush
selector app-stream-deploy-properties-debug
styleUrls .builder/styles.scss
templateUrl properties-debug.component.html

Index

Methods
Inputs

Constructor

constructor()

Inputs

raw

Array of properties

Type: Array<PropertiesDebug>

Methods

ngOnChanges
ngOnChanges(changes: SimpleChanges)

On Change

Parameters :
Name Type Optional Description
changes SimpleChanges
Returns : void
import { ChangeDetectionStrategy, Component, Input, OnChanges, SimpleChanges } from '@angular/core';

/**
 * Component used to display parameters of a stream deployment
 *
 * @author Damien Vitrac
 */
@Component({
  selector: 'app-stream-deploy-properties-debug',
  templateUrl: 'properties-debug.component.html',
  styleUrls: ['../builder/styles.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class StreamDeployPropertiesDebugComponent implements OnChanges {

  /**
   * Array of properties
   */
  @Input() raw: Array<PropertiesDebug>;

  constructor() {
  }

  /**
   * On Change
   * @param {SimpleChanges} changes
   */
  ngOnChanges(changes: SimpleChanges): void {
    if (changes.raw.currentValue) {
      this.raw = changes.raw.currentValue;
    } else {
      this.raw = [];
    }
  }

}

/**
 * Dedicate Interface for {@Link StreamDeployPropertiesDebugComponent}
 */
export interface PropertiesDebug {
  key: string;
  value: string;
  status: string;
}
<div *ngIf="raw && raw.length > 0" class="properties-box">
  <div class="property" *ngFor="let val of raw" [class.invalid]="val.status == 'invalid'">
    <span *ngIf="val.status == 'invalid'" class="fa fa-warning">
    </span>
    <span class="key">{{ val.key }}</span>
    <span class="equal"> = </span>
    <span class="value">{{ val.value }}</span>
  </div>
</div>
<div class="alert alert-info" style="display: inline-block" *ngIf="raw && raw.length == 0">
  No properties defined
</div>
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""