我正在努力处理如何处理来自打字稿中VSTS API的响应。来自REST API的复杂响应的Typescript接口
有没有办法处理这个接口?
export interface Fields {
'System.AreaPath': any;
'System.TeamProject': string;
'System.IterationPath': string;
'System.WorkItemType': string;
'System.State': string;
'System.Reason': string;
'System.AssignedTo': string;
'System.CreatedDate': Date;
'System.CreatedBy': string;
'System.ChangedDate': Date;
'System.ChangedBy': string;
'System.Title': string;
'Microsoft.VSTS.Feedback.ApplicationType': string;
'System.Description': string;
'System.History': string;
'Microsoft.VSTS.Feedback.ApplicationStartInformation': string;
'Microsoft.VSTS.Feedback.ApplicationLaunchInstructions': string;
}
在我的代码我试图环出字段(工作项===字段)
<tbody>
<tr *ngFor="let workitem of workItems">
<!-- *ngFor="let field of workitems.fields" -->
<td>{{workitem.fields.System.AreaPath}} << THIS IS NOT ALLOWED</td>
</tr>
</tbody>
任何一个得到了一个绝妙的主意如何解决这个问题?
item.fields [ 'name.with.dots'] –