You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exportclassModel{private_id: number;private_name: string;imageUrl: string;constructor(id: number,name: string,imageUrl: string){this.id=id;this.name=name;this.imageUrl=imageUrl;}getid(): number{returnthis._id;}setid(value: number){if(value<=0)thrownewError("ID must be greater than 0");this._id=value;}getname(): string{returnthis._name;}setname(value: string){if(value.length<8)thrownewError("Name must be at least 8 characters long");this._name=value;}}
This is how to ensure contrains in a typescript model.
The text was updated successfully, but these errors were encountered:
This is how to ensure contrains in a typescript model.
The text was updated successfully, but these errors were encountered: