Book Image

JavaScript JSON Cookbook

By : Ray Rischpater, Brian Ritchie, Ray Rischpater
Book Image

JavaScript JSON Cookbook

By: Ray Rischpater, Brian Ritchie, Ray Rischpater

Overview of this book

Table of Contents (17 chapters)
JavaScript JSON Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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>
<script src="json-example-angularjs.js"></script...