Tuesday, 5 May 2020

Build Your Own Blog - Your First Angular Project

<< Introduction                                                  Table of Contents                             Create Your First Component >>  

This post will explain everything you need to set up your first Angular project, the first step to creating our own blog website.

By the end of this post you will have a development environment ready for Angular development.

(If you're new here, I recommend visiting the Table of Contents)

Prerequisites:


Visual Studio Code Extensions:

I recommend downloading the following extensions in Visual Studio Code:
  • Sass 1.8.3 - For SASS syntax highlighting and AutoComplete

Install Angular

1. Open Visual Studio Code, and open the Terminal. View -> Terminal
2. Run npm install -g @angular/cli 
3. Run npm install --save-dev @angular-devkit/build-angular

Running these commands will install the Angular CLI and the devkits required to build Angular applications.

This gives us the ability to use ng commands that allow us to initialise an Angular project, add/remove components, add Angular Material to our project, etc


Initialising an Angular Project

1. Run the ng new command and follow the instructions to initialise a new angular project. The name of our blog web project will be 'redkiteblog'. 



After the project is initialised you will see a project structure as follows:



That's it! We now have the bare bones of an Angular project. 

2. Run ng serve



Once it has successfully built, I can access the project at http://localhost:4200/



Obviously, we don't want our blog to look anything like this, so next we'll be deleting all of this and creating our own blog.

<< Introduction                                                  Table of Contents                             Create Your First Component >>   

No comments:

Post a Comment