Hands-On Full Stack Web Development with Angular 6 and Laravel 5
上QQ阅读APP看书,第一时间看更新

Adding a new component

Now, we need a component to show a list of beers, since we just created a module called Beers.
Later, you will see how to use an API and an Angular service to load a list of beers; for now, we will focus on the creation of our component. 

Inside of the root folder, and with the integrated VS Code Terminal, type the following command:

ng g component beers

The preceding command will generate the following structure:

The BeersModule and Component files have been created. We now have our module, template, and component file. Let's add a new route.