Launch offer
Business website $150 USD Custom plugin $200 USD Ready in 5 days
Get a quote
AngularJS

Creating Your First AngularJS Application

Bootstrap a module, controller, and simple binding in HTML.

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

  1. Add angular.min.js.
  2. Create a module and controller.
  3. 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>

Leave a reply

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