Hello World Example in AngularJs

by Virender
November 28, 2013

This is “Hello World Example” of AngularJs.

<!DOCTYPE html>
<html>
<head lang=”en”>
    <meta charset=”UTF-8″>
    <title>Hello World Example </title>
    <!– Add angularjs script into html –>
    <script src= “http://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angular.min.js”></script>
</head>
<body ng-app=”” >   <!– Use ng-app directive to auto-bootstrap an angularjs application –>

    <div ng-init=”myMessage=’Hello World'” >  <!– Initialize variable –>

        {{myMessage}}     <!– Show message to view –>

    </div>

</body>
</html>

Share:

Tags:

Related posts