angular - 在同一页面角度中多次使用同一组件时避免多次 api 调用
问题描述
有人可以建议我如何在同一容器中的多个位置使用同一组件时避免多个 api 调用
class ChildComponent{
// some api calls and actions (api call is made in service)
}
parent.html
<child-component></child-component>
<child-component></child-component>
<child-component></child-component>
<child-component></child-component>
解决方案
推荐阅读
- php - 计算两个日期之间的天数应为两天,间隔为 1 天,但应计为 1 天
- flutter - 如何在颤动中序列化数组数组
- python - 一个python函数,它返回一个带有for循环的函数列表
- excel - 从标准另存为对话框获取文件名
- reactjs - 如何在点击反应原生时使用缩略图更改主图像滑块?
- performance - Haskell 上的 ICFPC 2006 任务太慢
- arduino - 诺基亚 5110 显示在 WeMos D1 中使用矩阵键盘 3x4 的键事件时不会改变
- python - gdal 已安装但在 Jupyter Notebook 中不起作用
- .net-core - Blazor DI 在 .razor 和商务类中的工作方式不同。为什么?
- postgresql - postgres 中的 CASE 查询不返回预期的输出