Angular
Building a CRUD Application with Angular & ASP.Net Core - Creating our Frontend Angular App

Your turn: Create an Angular app with the CLI

PRO

Your turn: Create an Angular app with the CLI

It's now your turn to create a new Angular application and the associated components. Think of the architecture that will work best for you. It may be exact same or very similar to mine. Consider drawing it out too, it can be difficult trying to keep all this information in your head.

Don't forget to also update your routes. If your architecture is anything like mine you will want to setup your default route to your homepage component.

Commands Used

ng new CampTrackerAngular

This command will build a brand new Angular application named CampTrackerAngular

  • ng is what we preface all Angular CLI commands with
  • new indicates that we want to create a brand new Angular app
  • CampTrackerAngular is the name of the application that we would like to create

ng g c camp-list

This command will generate a camp-list component for us.

  • ng is what we preface all Angular CLI commands with
  • g indicates that we want generate something new
  • c is short-hand for component, that is what we want to generate
  • camp-list is the name of the component that we want to generate

ng serve -o

This command builds and serves up our application. The -o option tells the command to open our default browser once complete. If we keep this running it will continue to rebuild and serve up our application when any file changes are made.

More info on the commands above can be found in the Angular CLI documentation.

 

I finished! On to the next chapter