How to use Angular.js on your local machine

There are several ways you can sample Angular.js on your local machine. One way is to use your locally installed server. The XAMPP or Node.js server can be the best option to use for executing the Angular.js code.

You can download the XAMPP server from https://www.apachefriends.org/download.html and install it over your PC. Once you are done with installation, you can just drop your Angular.js files/folders in the htdocs folder and access these files by simply visiting http://localhost/source/, where source should be the folder name inside htdocs.

Using Node.js, simply paste the following code to a text file and save it as app.js:

//sample node server from official site at https://nodejs.org/ var http = ...

Get Mastering JavaScript Promises now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.