Angular interface help

Angular interface help
0.0 0

#1

export interface UserResponse {
USD: object;
bpi: object;
company: string;
}
Its me again…
I wonder u can use class or interface to structure some kind of response.
I try connect component in angular so it shows
bpi.USD.rate_float value
but typescript complains cause is only bpi in interface how do I write an more detailed interface
with object path like bpi.USD.rate:>>>??


#2

I believe you can write something like this:

USD: {
  rate_float: number;
};

EDIT: Or you could use any instead of object, but that would kind of defeat the purpose of using an interface.


#3

YE it works like u said flawless.