I have the following classe or model:
export class Cuota{
constructor(
public _id: string,
public name: string,
public description: string,
public precio: number
){}
}
at the time of initializing this class in my component I get an error in the array because it is an array of strings and I have put the price as type number.
export class CuotaComponent implements OnInit{
public cuota: Cuota;
constructor(
private _route: ActivatedRoute,
private _router: Router,
private _userService: UserService,
private _cuotaService: CuotaService,
){
this.cuota = new Cuota('','','','');
}
I have several questions that I take to mention is related to the subject.
In performance in a MEAN project it is useful to put the property that touches each variable of the object, is that I enter the node database and I see everything in JSON format and one thinks if it is really necessary to declare type properties number or date.
Another question I have is between declaring the object in an interface or in a classe.
What's different? Should I create an interface instead of a classe?
Thank you very much.