File

src/app/manage-learn/shared/pipe/get-labels.pipe.ts

Metadata

Methods

getLabels
getLabels(question)
Parameters :
Name Optional
question No
Returns : {}
transform
transform(value: string, ...args: any[])
Parameters :
Name Type Optional
value string No
args any[] No
Returns : {}
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'getLabels',
})
export class GetLabelsPipe implements PipeTransform {
  transform(value: string, ...args) {
    return this.getLabels(value);
  }
  getLabels(question) {
    const labels = [];
    for (const option of question.options) {
      if (question.value.indexOf(option.value) > -1) {
        labels.push(option.label);
      }
    }
    return labels;
  }
}

results matching ""

    No results matching ""