I have created model(by interface) for my json response:
export interface Test {
id: number;
name: string;
}
and I have variable for data:
public test: Test;
But when I get json response with more parameters like last_name which is not in interface I still can use it in code. How can I cast this json response to match only my model?
I tried assertion but It's not working, I still have access to all other properties.