Skip to content
Snippets Groups Projects
pretty-operator.pipe.ts 712 B
Newer Older
  • Learn to ignore specific revisions
  • /**
     * This file is part of Anis Client.
     *
     * @copyright Laboratoire d'Astrophysique de Marseille / CNRS
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */
    
    import { Pipe, PipeTransform } from '@angular/core';
    
    import { getPrettyOperator } from 'src/app/instance/store/models';
    
    /**
     * @class
     * @classdesc Translate Anis string operator to a pretty form label operator.
     *
     * @example
     * // formats eq to =
     * {{ eq | prettyOperator }}
     */
    @Pipe({ name: 'prettyOperator' })
    export class PrettyOperatorPipe implements PipeTransform {
        transform(operator: string): string {
            return getPrettyOperator(operator);
        }
    }