OpenSlides/client/src/app/site/motions/models/view-motion-block.ts

40 lines
968 B
TypeScript
Raw Normal View History

2018-12-06 12:28:05 +01:00
import { BaseViewModel } from 'app/site/base/base-view-model';
import { MotionBlock } from 'app/shared/models/motions/motion-block';
/**
* ViewModel for motion blocks.
* @ignore
*/
export class ViewMotionBlock extends BaseViewModel {
private _motionBlock: MotionBlock;
public get motionBlock(): MotionBlock {
return this._motionBlock;
}
public get id(): number {
return this.motionBlock ? this.motionBlock.id : null;
}
public get title(): string {
return this.motionBlock ? this.motionBlock.title : null;
}
public get agenda_item_id(): number {
return this.motionBlock ? this.motionBlock.agenda_item_id : null;
}
public constructor(motionBlock: MotionBlock) {
super();
this._motionBlock = motionBlock;
}
public updateValues(update: MotionBlock): void {
this._motionBlock = update;
}
public getTitle(): string {
return this.title
}
}