I'd like to map
{
"controller-element": { }
}
into an interface
but because controller-element
has a -
I can't simply do
export interface IControllerResponse {
controller-element: any;
}
Just enclose the field name in quotes:
export interface IControllerResponse {
"controller-element": any;
}
const response: IControllerResponse={
"controller-element": 123
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.