Getting started with Angular / Angular-CLI – Part 1

March 3, 2017

This post I’ll introduce you to Angular CLI (command line interface) and how you can use it to get started quickly with building your Angular app.

The roadmap for this blog series:

  • Introduction to Angular CLI and using it to create a new Angular app
  • Using Angular CLI for creating components, routes, services and more
  • Adding in Bootstrap to update the look and feel of your Angular app
  • Finally I’ll take a look at deploying and running your Angular apps on Azure

Installation

Both the Angular CLI and its generated projects have dependencies that require Node 6.9.0 or higher, together with NPM 3 or higher.

npm install -g @angular/cli

image

After installation you can access help by running the following command:

ng help

 

Creating a New Angular App

To generate a new Angular app, just run the following command where “angular-cli-app” is the name of your app:

ng new angular-cli-app

image

Generating and Serving your App

Once your project is scaffold, navigate to your project folder and then run the following command to serve your project via a local development server:

cd angular-cli-app
ng serve

 

image

 

Once your app is up and running, navigate to http://localhost:4200/ to see it. Once the app is running, any changes you make will automatically apply and your app will reload.

image

As you can see it’s fairly straight forward to get started with an Angular app. The Angular CLI really takes care of everything for you compared to the days where you have to manually copy and paste the references and create each file necessary to get your app started.

In the next post I’ll dig deeper into using Angular-CLI to create components, routes, services and other stuff.

Source for this sample can be found here.

Enjoy!

References

Angular
Angular CLI

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

toon vanhoutte

Blogging about connecting devices, systems and people! On-premises and in the cloud. Microsoft stack only.

Ken Cenerelli

My life in software development

scomfaq.wordpress.com/

Things about System Center and Cloud...

Build HoloLens

All about HoloLens

DevDays®

For web designers and cloud developers

Build Azure

All about the Microsoft Cloud

vishal patel

Software Developer, Windows 8 and Windows Phone Enthusiast

SQL with Manoj

SQL Server (TSQL) Programming, DB concepts, Tips & Tricks with >400 articles... comments welcome!!!

dragablz.wordpress.com/

Dragable, tearable, dockable WPF TabControl. Open source to boot.

Adrian Hall

Because Developers are Awesome

Ratish Philip's Blog

Another adventure in code...

codematrix

Application Architecture at it's best

One Unicorn

Thoughts from one member of the Entity Framework team...

Rachel Lim's Blog

Simplifying programming into something I can understand

.NET Developer's Blog

Software Development, Flying and Life

The Flying Maverick

Software Development, Flying and Life

Hiking Photography

Beautiful photos of hiking and other outdoor adventures.

paint.net blog

The best free image and photo editor. By Rick Brewster.

Learning by Shipping

products, development, management...

%d bloggers like this: