Showing posts with label Child Component. Show all posts
Showing posts with label Child Component. Show all posts

Thursday, October 11, 2018

Child component example in Angular 6

Angular applications are built with a set of components often nested set of components. We can embed a component inside another component using the nested components selector tag. Let us create a very basic child component and embed it in the home component.

Let us start with creating a child component using the following command

ng g c child

The command will create a component class file child.component.ts and a template file child.component.html. In this example we will not make any changes to the class file, we will add a simple message to the template file.