【问题标题】:How to limit the json reponse for display in Angular 11?如何限制 Angular 11 中显示的 json 响应?
【发布时间】:2021-09-12 06:45:24
【问题描述】:

我有一个带有 Spring 引导模块的 Angular Web 应用程序的要求。

Spring boot 与 REST API 通信并向 Angular Web 应用程序提供响应。

因此,REST API 发送大型 JSON 对象数组,我必须在网格中显示 json。我必须显示maximum 1000 rows 的数据。

由于无法在服务器端进行更改,如何限制显示数据的大小?

【问题讨论】:

  • 能否在问题代码中添加数据结构?您想展示什么以及您想如何展示?

标签: json angular typescript spring-boot angular11


【解决方案1】:

const dataToDisplay = incomingData?.slice(0, 1000);

【讨论】:

    猜你喜欢
    • 2018-07-18
    • 1970-01-01
    • 1970-01-01
    • 2020-12-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-16
    • 1970-01-01
    相关资源
    最近更新 更多