2018-10-15 11:52:57 +02:00
|
|
|
import { TranslateService } from '@ngx-translate/core';
|
|
|
|
|
2019-02-08 16:02:46 +01:00
|
|
|
import { Selectable } from './selectable';
|
|
|
|
|
2018-10-15 11:52:57 +02:00
|
|
|
/**
|
|
|
|
* Class to display an "empty" Selectable
|
|
|
|
*/
|
|
|
|
export class EmptySelectable implements Selectable {
|
|
|
|
/**
|
|
|
|
* Since it is just empty, it could be just fixed 0
|
|
|
|
*/
|
|
|
|
public id = 0;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Empty Constructor
|
|
|
|
* @param translate translate Service
|
|
|
|
*/
|
|
|
|
public constructor(private translate?: TranslateService) {}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* gets the title
|
|
|
|
*/
|
2019-02-08 16:02:46 +01:00
|
|
|
public getTitle = () => (this.translate ? this.translate.instant('None') : 'None');
|
2018-10-15 11:52:57 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* gets the list title
|
|
|
|
*/
|
2019-02-08 16:02:46 +01:00
|
|
|
public getListTitle = () => this.getTitle();
|
2018-10-15 11:52:57 +02:00
|
|
|
}
|