AngularCLI: a command line interface for Angular
In order to have a tool to manage Angular better, it is that AngularCLI arises. AngularCLI is a command line interface for Angular, with it, we can create an application that already works, right out of the box.
So, if you use Angular or you want to learn about it, you have to install AngularCLI.
Getting AngularCLI on Ubuntu 18.04
Before we go on, you need to know that we will need NodeJS. Next, you have to be able to use sudo with your user. Besides, you need some knowledge about the use of the terminal in Ubuntu.
Install NodeJS on Ubuntu 18.04
The first step is to install NodeJS 10 at least. Don’t worry it’s quite simple and we’ve made a post dedicated to it.
Then you can continue with the tutorial.
Install AngularCLI on Ubuntu 18.04
Once you have made sure that NodeJS and NPM are properly installed in the terminal run the following.
:~$ sudo npm install -g @angular/cli
Next, check the installed version.
:~$ ng new example-project
Then, access the directory of your newly created project. Then, using the serve command, you can access your application. Note that the default port is 4200.
:~$ cd example-project :~$ ng serve
This will make the application available at http://localhost:4200, but many times we need to specify a particular host. To do this, run:
:~$ ng serve --host [host_ip] --port [port]
Next, open it using your web browser. For example, http://192.168.250.7:4200.
And that is it.
Thanks to this post, you have learned how to install AngularCLI in Ubuntu 18.04. This being one of the most used distributions to develop applications for its stability and ease of use.
In this sense, it is possible to affirm with almost total certainty that AngularCLI facilitates the management of Angular projects. Thus it is possible to improve our productivity.
Please share this post with your friends.