Setup and Run an Angular 4 Project

Angular 4 was available on past March 23, with some new features and changes, that make it an smaller and faster framework to build modern web and mobile application.

Some features like: 
  • a powerful View Engine
  • Animation Package
  • Improved *ngIf and *ngFor
  • TypeScript 2.1 and 2.2 compatibility
  • Angular Universal: it allow to run Angular on a server.
Ok, let's start creating and running an Angular 4 project, from scratch.

Install Node and NPM

First, you need to have Node and NPM.  Verify that you are running at least node 6.9.x and npm 3.x.x by running node -v and npm -v in a terminal/console window. Older versions produce errors, but newer versions are fine.

If you are from Mac, you can use brew (brew install node). If you are from Linux, you can use the nodesource repos.

Create a new project with Angular CLI

Angular CLI is a very easy tool, that can help you create some initials scripts, like the project, providers, components, modules, etc.  Check out the complete documentation for more details.

Run this two commands. The first one will create the environment and will install core requirements. 

The second one will create all the directories and files that you need for your project. 

npm install -g @angular/cli

ng new my-new-app


and basically that's all. 

Run the project

To run this project, you just run this command. This will compile your code, and open your web browser on http://localhost:4200

ng serve --open

Hope you can replicate this on your local, and share with me if you are having troubles.
I'm right now playing with Angular 4 and Firebase. A new post soon :)

Popular posts from this blog

Introducing 4Geeks Payments

We are hiring software devs in Guadalajara, Mexico.

How We Ensure the Best Devs to Work On Your Project