import {Component, OnInit, Pipe, PipeTransform, ViewEncapsulation} from '@angular/core'; import {FieldType} from '@ngx-formly/material'; @Component({ selector: 'app-check-box-custom', templateUrl: './check-box-custom.component.html', styleUrls: ['./check-box-custom.component.scss'], encapsulation: ViewEncapsulation.None }) export class CheckBoxCustomComponent extends FieldType implements OnInit { checkboxOptions: any[] = []; constructor() { super(); } ngOnInit(): void { this.setOptions(); } setOptions(): void { if (this.field && this.field.templateOptions && this.field.templateOptions.options) { this.field.templateOptions.options.forEach((option: any) => { this.checkboxOptions.push(option); }); } } }