Adding a dependency to AngularJS to your web page

Just as another JavaScript framework, you need to include AngularJS in your HTML. As you'll see in this section, there are a few other things you do differently to get set up. First, be sure that you create a new HTML file, such as json-example-angular.html.

How to do it...

Here's the HTML for our application in its entirety:

<!doctype HTML> <html> <head> </head> <body ng-app="aprsapp"> <div ng-controller="AprsController"> <button ng-click="doAjax()">Send AJAX Request</button> <div>{{debug}}</div> <div>{{json}}</div> <br/> <div>{{message}}<div> </div> <p>Powered by <a href="http://www.aprs.fi">aprs.fi</a></p> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script> ...

Get JavaScript JSON Cookbook 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.