export interface team {
football:Football
table-tennis:TableTennis
}
export interface Football{
goalPost:any
ball:any
}
export interface TableTennis{
bat:any
ball:any
}
CodePudding user response:
Encase the key name in quotes, similar to how you would do it in JSON
export interface team {
football: Football,
"table-tennis": TableTennis
// use a string!
}
export interface Football {
goalPost: any,
ball: any
}
export interface TableTennis {
bat: any,
ball: any
}
CodePudding user response:
You would use quotes, like how you would in JavaScript:
export interface team {
football: Football;
"table-tennis": TableTennis;
}