This is the first article in the series of Demystifying Angular. I'm planning to write a dozen or more articles on Angular under this title. There is no schedule/plan on release date of each article.
The prerequisites fall into two categories - background knowledge & system requirements.
node version greater than 10 and
npm greater than 6. If you have lower versions than these, please update with latest one.
cli is powerful tool that help you to build a basic application and install all needed dependencies for this basic application. The installation can be done via following command -
$ sudo npm install -g @angular/cli
@ means organization and
cli means package under given organization. After installation you will get
ng command. A quick version command will let you know that the angular is installed on your system or not.
$ ng --version
Currently, it is showing
8.1.2 on my system. So, the installation is done. The next step is to create an application using
You can easily create a new application using
new command like -
$ ng new my-app
This command will create
my-app via default scaffold. You can get the complete information of this command via
ng new --help command. FYI, an angular application has huge dependency to install so it will take some time to install all the need packages/dependency. This command basically do two things - first it scaffold an application and second install the dependencies. Once the installation is done, go inside of folder via command line -
$ cd my-app
Now, you can run this command using
serve command like -
$ ng serve --open
This will compile your angular application and automatically open the website at
http://localhost:4200 in default browser. The command continuously runs inside of command line and do hot-reloading if you change something in code within application.
That's it for this article. In this article, you installed the needed software and a weapon to work with angular. You might not notice but you actually has create a working application in angular. A good start always take you further to the end goal.
Level up every day