首页 > 解决方案 > 在同一页面角度中多次使用同一组件时避免多次 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>

标签: angular

解决方案


推荐阅读