src/app/streams/stream-deploy/properties-debug/properties-debug.component.ts
Component used to display parameters of a stream deployment
changeDetection | ChangeDetectionStrategy.OnPush |
selector | app-stream-deploy-properties-debug |
styleUrls | .builder/styles.scss |
templateUrl | properties-debug.component.html |
Methods |
Inputs |
constructor()
|
raw
|
Array of properties
Type: |
ngOnChanges | ||||||||
ngOnChanges(changes: SimpleChanges)
|
||||||||
On Change
Parameters :
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>