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
Sur cette page du site, vous pouvez voir la vidéo en ligne Angular component interaction [Part 5] durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Techie Ocean 22 novembre 2017, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 2,949 fois et il a aimé 17 téléspectateurs. Bon visionnage!