import { Pipe , PipeTransform } from '@angular/core' ; import { CmdbCategoryTree } from '../../framework/models/cmdb-category' ; @ Pipe ( { name : 'categoryTreeFilter' } ) export class CategoryTreeFilterPipe implements PipeTransform { /**
     * Filter the category tree structure by category label
     * Letters will be transformed to lowercase.
     */ transform ( categoryTree , label ) { return categoryTree . filter ( node => node . category . label . toLowerCase ( ) . includes ( label . toLowerCase ( ) ) ) ; } }