Browse cities

About to build your very first Angular app? Then you must be planning to create an Angular project with Angular CLI, right? The much-acclaimed tool that the Angular team built precisely to jumpstart the whole development process.

… to have a simple app scaffolded, generated and deployed in no time, by entering just a few commands (so they say, at least). 

And since I'm sure that you don't want to waste these bundles of convenience by letting yourself tangled up in overly complex explanations instead, I've kept things simple with this guide.

So, here's how you create and run your first Angular project via the Angular command-line interface:

1. But How Precisely Can Angular CLI Jumpstart Your App's Development Process?

Take this command-line interface as a starter kit “present” that the Angular team has nicely wrapped for you:

  • it's practically geared at empowering you to get up and start developing a new Angular app in no time
  • it takes just one short command to generate a default Angular project that would include all the needed dependencies (in the node_modules folder), as well as testing files for each component

Now, this is what I call a major kickstart! It's got you covered from the stage of setting everything up, to creating the Angular project itself, to testing it and finally deploying it.

Other key usages of the Angular CLI that we're not going to focus on in this tutorial here are:

  • real-time server maintenance and support
  • building applications for production
  • adding new features to your existing app 
  • running tests on your application units 

2. Setting It Up: Install Angular CLI Globally

Before you jump to the part where you create an Angular app using Angular CLI, you need to install the command-line interface itself. Globally!

And this is the “power” command to enter in your terminal with the npm installed:

npm install -g @angular/cli 


  • if you already have the CLI installed, make sure it's the latest version
  • if you need to update it, these are the commands to enter:
npm uninstall -g angular-cli
npm uninstall --save-dev angular-cli 

And there's more! A few more must-have dependencies that you need to make sure that are already installed and upgraded to their latest versions:

  • Node.js: v6.9.x +
  • npm: 3.x.x +

3. Create an Angular Project With Angular CLI

With your command line interface ON, use it to enter THE one and only command that will generate a new Angular project for you. One incorporating, by default, all the needed dependencies:

ng new ng-yourproject

Tada! A yourprojectnamed directory has just been generated. That's where your new Angular project — along with all the requested dependencies — gets stored.

Eager to test it out? Just run the following command in your terminal:

ng serve

Your Angular app will then get built and served up to localhost:4200. Feel free to open this URL in your browser and it's the here-below screen that you should be able to see:

Create an Angular Project with Angular CLI- App Works!

Basically, it's the default application shell itself rendered by the CLI.

4. “Deconstructing” Your New Angular Project: What Does It Include?

Now, before you go ahead and do your “tweaking” on your newly created app, let's see what you've got in there! What are the elements that the CLI has generated for you to help you jump to development right out of the box?

For this quick “scan”, open your Angular project in your IDE of choice and start “exploring” your src/folder:



  • any styles that you'll plan to apply globally, it's this file that you can add them to; and it's here, as well, that you can import new .css files (Bootstrap or any other styling frameworks of your choice)


  • where your Angular app gets started



  • this is where your app's one and only (for now at least) component gets stored


  • the modules Angular needs for managing your app's components
  • note: @NgModule marks the class file as a module and this is what makes it similar to @Component

5. Create a New Component 

Remember your “one and only component” that I mentioned during the previous “inventory” of all the “bunch of stuff” that CLI has generated in your project?

Well, how about creating a new one now? One that would load under that root component?

Just run the following command to generate it:

ng generate component the-quote

Next, time to “show it off” in your browser:

<small>- {{}}</small> 

Add the app-the-quote selector to the root component that the CLI generated in your Angular project:


6. Apply External Styling 

Now you do agree that when you create an Angular project with Angular CLI applying styling is a key step.

So, let's add your favorite CSS framework to your new application!

Me, it's Bulma that I'll be using in this tutorial here:

npm install bulma --save 

With our CSS framework installed, we'll need to enable it to load the CSS file into our Angular app. For this, just place the relative path within the .angular-cli.json file., to the file in the styles array more precisely.

 "styles": [

“Tempted” to display some icons now, as well? Then go ahead and add the font-awesome library as cdn link.

For this, just include the stylesheet right into your index.html:

<link rel="stylesheet" href="">

Et voila! This is how you create an Angular project with Angular CLI!

What do you think? Is the Angular command-line interface an extremely useful tool to jumpstart your project with or did you expected your “starter kit” to include, right out-of-the-box, more elements to get you started?


We do Web development

Go to our Web development page!

Visit page!

Recommended Stories

How to Integrate AI into Your Drupal Website The... Easy Way: 7 Drupal 8 AI Modules at Hand
How can you take advantage of artificial intelligence and get the most of Drupal's robust content management… (Read more)
Adriana Cacoveanu / Jan 24 '2020
The 5 Best Automation Testing Tools for Web Applications that You Could Use in 2020 (Powerful and Easy to Use)
You save time, you keep errors to a minimum, you free up mental real estate that you could then invest in other… (Read more)
Silviu Serdaru / Jan 21 '2020
Apigee Edge Microgateway: Why Would You Want to Use It and When Should You? 10 Typical Use Cases
So you're evaluating and comparing all the available solutions for centralizing and standardizing your APIs. And… (Read more)
Adriana Cacoveanu / Jan 17 '2020