Anatomy of a simple AngularJS app
Perform the following steps:
- To start, let's first download a version of AngularJS from http:www.angularjs.org.
- Click on the Download button and select the following options from the pop-up window:
- Branch: Select Stable
- Build: Select Minified
- Download the JS file and place it in your project's folder.
Let us start by writing a simple AngularJS app. Create an index.html
file with the following code:
<!DOCTYPE html> <html> <head> <title>AngularJS Basic</title> </head> <body ng-app ng-init=" myName ='John Doe' "> {{myName}} is {{ 2014-1968}} years old. <script src=" angular.min.js " type="text/javascript "> </script> </body> </html>
This is a regular HTML page with the HTML5 doctype
and the AngularJS JavaScript file being ...
Get AngularJS Web Application Development Blueprints 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.