This tutorial shows how to call the child component's functions from the parent component using the @Viewchild.
In previous tutorial, we have seen how to call child function from parent component using local variable. But the drawback of local variable method is that it is accessible only in the parent template where it is defined. If we want to use it in parent component class then it is not accessible. So to overcome this drawback we use @Viewchild method. Through Viewchild we inject the child component in the parent component class and thus it is acessible in the class of parent component.
To demonstrate this, the tutorial implements a timer functionality. And the timer can be started or paused by calling the internal functions of the child component from the parent component.
#Angular #Angular 8 #Angular7 #Angular 6 #Angular 5
Nesta página do site você pode assistir ao vídeo on-line Angular component interaction [Part 5] duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Techie Ocean 22 Novembro 2017, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 2,949 vezes e gostou 17 espectadores. Boa visualização!