all files / common/core/item-list/ item.component.ts

90.91% Statements 10/11
100% Branches 0/0
75% Functions 3/4
88.89% Lines 8/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31                                      101×        
/*
 *  @license
 *  Copyright Hôpitaux Universitaires de Genève. All Rights Reserved.
 *
 *  Use of this source code is governed by an Apache-2.0 license that can be
 *  found in the LICENSE file at https://github.com/DSI-HUG/dejajs-components/blob/master/LICENSE
 */
 
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { Component, Input } from '@angular/core';
 
@Component({
    selector: 'deja-item',
    template: '',
})
export class DejaItemComponent {
    @Input() public value: string;
    @Input() public text: String;
 
    @Input()
    public set selected(value: boolean | string) {
        this._selected = coerceBooleanProperty(value);
    }
 
    public get selected() {
        return this._selected;
    }
    private _selected: boolean;
}