Create a “First Project” in Angular JS Application

Here is a simple example of an AngularJS application. This code will display a greeting and a button that, when clicked, will change the greeting:

<!DOCTYPE html>
    <script src=""></script>
      // Define an AngularJS module
      var app = angular.module('myApp', []);

      // Define a controller for the module
      app.controller('myCtrl', function($scope) {
        $scope.greeting = 'Hello';

        $scope.changeGreeting = function() {
          $scope.greeting = 'Hola';
  <body ng-app="myApp" ng-controller="myCtrl">
    <h1>{{ greeting }}</h1>
    <button ng-click="changeGreeting()">Change greeting</button>

This code will display “Hello” on the page, and when the button is clicked, the greeting will change to “Hola”.