OpenSlides/client/src/app/site/base/base-view-model.ts

26 lines
689 B
TypeScript
Raw Normal View History

import { BaseModel } from '../../shared/models/base/base-model';
import { Displayable } from '../../shared/models/base/displayable';
import { Identifiable } from '../../shared/models/base/identifiable';
2018-09-10 15:53:11 +02:00
/**
* Base class for view models. alls view models should have titles.
*/
export abstract class BaseViewModel implements Displayable, Identifiable {
/**
* Force children to have an id.
*/
public abstract id: number;
2018-09-10 15:53:11 +02:00
public abstract updateValues(update: BaseModel): void;
public abstract getTitle(): string;
2018-09-10 15:53:11 +02:00
public getListTitle(): string {
return this.getTitle();
2018-09-10 15:53:11 +02:00
}
public toString(): string {
return this.getTitle();
2018-09-10 15:53:11 +02:00
}
}