As a beginner in TypeScript, I am currently using it to develop Angular applications. I've noticed that some models are structured like this:
export interface Item {
name: string
}
while others follow this pattern:
export class Lesson {
constructor(
public $key:string)
}
They also include static methods such as:
static fromJson({$key}) {}
What advantages does this approach offer?