I have variables declared in the .ts file:
export interface Payment {
paymentStatus?: string
}
In the component.ts file, I create:
filters: PaymentFilters = {
paymentStatus: null
}
In console I get:
Type null is not assigned to type string
and
type string | null is not assigned to type string.
Why do I get such an error when I declare that the variable is a string and can optionally occur?
undefinedinstead ofnull?addToQueryParams?function addToQueryParams(variable: Payment, prop: string, value: string): string?