Using Controllers and Scopes with AngularJS: Preparing the Example Project

For this chapter I created an HTML file called controllers.html in the web server angularjs directory. You can see the initial contents of the new file in Listing 13-1.

Listing 13-1. The Contents of the controllers.html File

<!DOCTYPE html>

<html ng-app=”exampleApp”>



<script src=”angular.js”></script>

<link href=”bootstrap.css” rel=”stylesheet” />

<link href=”bootstrap-theme.css” rel=”stylesheet” />


angular.module(“exampleApp”, []);




<div class=”well”>

Content will go here.




The file contains a minimal AngularJS application with a module—but nothing else. You can see the effect of displaying the controllers.html file in the browser in Figure 13-1.

Source: Freeman Adam (2014), Pro AngularJS (Expert’s Voice in Web Development), Apress; 1st ed. edition.

Leave a Reply

Your email address will not be published. Required fields are marked *