什么时候加载所有组件? [英] When are all my components loaded?

查看:52
本文介绍了什么时候加载所有组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个组件,它有几个孩子,他们可能也有一些孩子.我无法预测是否将加载所有子项,因为这取决于您所查看的内容.我要实现的是一个加载指示器,该指示器在加载内容时显示.但是我不想为每个组件显示一个加载指示器,因为我最终将拥有10-15个加载指示器.

I'm having a component, which has several children and they might also have some children. I can not predict, if all the children will be loaded, since it depends on the content your looking at. What I want to achieve, is a loading indicator which show while the content is loaded. But I don't want to display a loading indicator for every component, because I'll end up having 10-15 loading indicators.

我的想法是,根父级显示一个加载指示符,一旦所有子级都初始化,加载指示符就可以消失.但是,如何确保所有子代都已装载?

My idea is that the root parent, displays a loading indicator and once all the children are initialised the loading indicator can disappear. But how can I make sure that all the children are loaded?

推荐答案

AppComponent

这篇关于什么时候加载所有组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆