import { Pipe, PipeTransform } from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';

@Pipe({
  name: 'numberArray'
})

export class NumberArrayPipe implements PipeTransform {

  constructor() {

  }
  transform(value: any, args?: any): any {
    if (value === undefined) {
      return [];
    }
    const max = parseInt(value, 10);
    const array = [];
    for (let index = 1; index <= max; index ++) {
      array.push(index);
    }

    return array;
  }
}
