Files
webapp-dto/dto/wordresponse.dto.ts
T

23 lines
486 B
TypeScript

export class WordResponseDTO {
constructor(partial: Partial<WordResponseDTO>) {
if (partial.id) this.id = partial.id
if (partial.value) this.value = partial.value
if (partial.ownerId) this.ownerId = partial.ownerId
if (partial.enabled) this.enabled = partial.enabled
}
id: number;
value: string;
ownerId: string;
enabled: boolean;
loading?: boolean = false
toJSON() {
return { ...this } // here I make a POJO's copy of the class instance
}
}