Creating Your First AngularJS Application — a practical guide to first AngularJS application with clear examples you can reuse in real projects.
AngularJS Tutorial Series (8/99). Prefer one article? Read the complete AngularJS tutorial.
Short description
Confirm the app name in ng-app matches angular.module(…).
Steps
- Add angular.min.js.
- Create a module and controller.
- Bind a value in the template.
Hello AngularJS
<div ng-app="helloApp" ng-controller="HelloCtrl as vm">
<p>{{ vm.message }}</p>
</div>
<script>
angular.module('helloApp', [])
.controller('HelloCtrl', function () {
this.message = 'Hello AngularJS';
});
</script>