I have a new group called GroupA
group A {
value1: string;
value2: string;
total(): number {
return value1 + value2;
}
}
I want to store instances of GroupA in my database, but when I retrieve them, they are in Object format which does not allow me to call the total
method.
Is there a way to specify a constructor for firebase get requests or convert Objects back to GroupA objects easily?