Web Building - AngularJS

Building a web site from scratch.   Part VIII: Using AngularJS.

What We Will Do

In this chapter we will:

  • Use AngularJS to fetch and display data on a website

Put the following code inside the file:


<!DOCTYPE html>

<title>Our Company</title>
<link href="Site.css" rel="stylesheet">


<nav id="nav01"></nav>

<div id="main">
  <div id="id01"></div>
  <div ng-app="" ng-controller="customersController">
    <tr ng-repeat="x in names">
    <td>{{ x.Name }}</td>
    <td>{{ x.City }}</td>
    <td>{{ x.Country }}</td>

  <footer id="foot01"></footer>

<script src="Script.js"></script>

function customersController($scope,$http) {
    .success(function(response) {$scope.names = response;});

<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>


Try it Yourself »

The code above is much same as in the previous chapter.

Only this time the data is fetched and displayed with AngularJS.

Read More

Read more about AngularJS in our AngularJS Tutorial.


Color Picker