File

src/property/property.pipe.ts

Description

Returns a specific property by its ID out of a list.

Metadata

name arProperty

Methods

transform
transform(properties: PropertySet, id: string)
Parameters :
Name Type Optional Description
properties PropertySet
id string
Returns : Property
import { Pipe, PipeTransform } from '@angular/core';

import { Property, PropertySet } from '../models/index';

/**
 * Returns a specific property by its ID out of a list.
 */
@Pipe({name: 'arProperty'})
export class PropertyPipe implements PipeTransform {
    transform(properties: PropertySet, id: string): Property {
        let p = properties.filter(prop => prop.id === id)[0] || undefined;
        return p;
    }
}

results matching ""

    No results matching ""