AngularJS Hello World

AngularJS Hello World

This is simple AngularJS Hello World where we will create one variable and put inside the scope and print its value.

  • HTML Page:
<!DOCTYPE html>
<html data-ng-app="myapp">
<head>
<meta charset="ISO-8859-1">
<title>AngularJS Tutorial</title>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js"></script>
<script>
    var app = angular.module('myapp', []);

    app.controller('HelloWorldController', function($scope){
        $scope.variable = "AngularJS Hello World!!!";
    });
</script>
</head>
<body data-ng-controller="HelloWorldController">
	<div>
		<p>{{variable}}</p>
	</div>

</body>
</html>
  • Output:

AngularJS Hello World

  • Run this code in Plunker here 

Leave a Reply

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