OpenSlides/client/src/app/shared/components/empty-selectable.ts

30 lines
665 B
TypeScript
Raw Normal View History

import { TranslateService } from '@ngx-translate/core';
2019-02-08 16:02:46 +01:00
import { Selectable } from './selectable';
/**
* 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');
/**
* gets the list title
*/
2019-02-08 16:02:46 +01:00
public getListTitle = () => this.getTitle();
}