I have been searching everywhere and can't find a solution to my unique issue. I am hoping someone can help me out as it would save me a lot of time and effort. The problem is that I need to use the variable name "new" in my Typescript class constructor, but I'm not sure how to do it. My backend is built with node.js:
product.model.ts
export class ProductModel {
constructor(
public id?: number,
public title?: string,
public description?: string,
public type?: string,
public data?: string,
public collections?: any,
public category?: string,
public price?: number,
public sale?: boolean,
public discount?: number,
public new?: boolean,
public quantity?: number,
public tags?: any,
public variants?: any,
public images?: any
) { }
}
I have attempted to use the string form for the variable "new" in the constructor, but it did not work.
...
public 'new'?: boolean