add optional field in angular class code example
Example: angular make variable optional
export interface User {
id: number;
name?: string; // interfaces allow fields to be optional
}
export interface User {
id: number;
name?: string; // interfaces allow fields to be optional
}