Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to Create Your Angular Application with Angular CLI

    How to Create Your Angular Application with Angular CLI

    By RahulJuly 14, 20203 Mins Read

    Angular is an javascript frameworks, libraries, assets, and utilities. This tutorial will help you to create an Angular application using the Angular CLI tool on any platform. The angular project provides and Command Line Interface called Angular CLI for the automation. You can do automating operations in Angular projects instead of doing them manually and save the time and effort. Using the Angular CLI, You can do the followings:

    Advertisement
    • Creating new project.
    • Setup application Environment.
    • Manage application configurations.
    • Building components, services and routing system.
    • Starting application, testing and deploying the project.
    • Installing 3rd party libraries like Bootstrap, Sass etc.
    • Let’s create your Angular Application:

      Prerequisites

      Angular required Nodejs to be installed on your system. You can following one of the following tutorials to install Angular on your system as per your operating system.

      • Install Node.js on Windows
      • Install Node.js on CentOS and Fedora
      • Install Node.js on Ubuntu and Debian and LinuxMint

      After installation, make sure the Node.js and NPM are correctly installed.

      node -v
      
      v12.4.0
      
      npm -v
      
      6.9.0
      

      Install Angular CLI

      Now, Install the Angular CLI utility using the NPM package manager.

      npm install -g @angular/cli
      

      The -g option with installation insures to install the Angular CLI globally on system. So, it will be accessible to all users and application on the system. Angular CLI provides a command ng used for command line operations. Let’s check the installed version of ng on your system.

      ng --version
      
      
           _                      _                 ____ _     ___
          / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
         / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
        / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
       /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                      |___/
      
      
      Angular CLI: 8.0.3
      Node: 12.4.0
      OS: linux x64
      Angular:
      ...
      
      Package                      Version
      ------------------------------------------------------
      @angular-devkit/architect    0.800.3
      @angular-devkit/core         8.0.3
      @angular-devkit/schematics   8.0.3
      @schematics/angular          8.0.3
      @schematics/update           0.800.3
      rxjs                         6.4.0
      

      Create Angular Application

      Your system is ready for building an Angular Application. The following command will create the Angular application with name hello-angular.

      ng new hello-angular
      

      This will create a directory with your project name and create all files under it. It also installs all the required libraries in that directory. On successful creation, you will see the below message on the screen.

      ...
      ...
      added 1011 packages from 1041 contributors and audited 19005 packages in 55.774s
      found 0 vulnerabilities
      
          Successfully initialized git.
      

      Run Angular Application

      Your basic Angular application is ready to serve. Change to directory hello-angular and run your Angular application using ng serve command.

      cd hello-angular
      ng serve
      

      Create Angular Application with CLI

      You can access your angular application on localhost port 4200, Which is the default host and port used by Angular application.

        http://localhost:4200
      

      Angular in web browser

      You can change host and port for running Angular application by providing –host and –port command line arguments.

      ng serve --host 0.0.0.0 --port 8080
      

      The IP address 0.0.0.0 listens on all interfaces and publically accessible.

    Angular Angular-cli
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    Implementing a Linux Server Security Audit: Best Practices and Tools

    15 Practical Examples of dd Command in Linux

    Iptables: Common Firewall Rules and Commands

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.