Angular Saying Hello!!!

anguarhello

Angular is one of the most popular java script frame work.

Steps:

Add angular CDN.
Create a angualr module and controller.
Now apply ng-app and ng-controller in HTML.
Run the application.

<html>
    <head>
        <title>Angular App</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
        <script>
            // creating module
            var app = angular.module('app',[]);
            // createing controller
            app.controller('appctrl', function($scope){
                $scope.message = "Hello World!!!";
            });
        </script>
    </head>
   <body ng-app="app">  <!--This statement bootstraps the angular-->
<div ng-controller="appctrl">
 <!--Add a contrller to div-->
<h1> welcome to Angular App</h1>
Change the message and see what happens

        <input type="text" ng-model="message">

 {{message}}</div>
</body>
</html>
Advertisements

About sivateja

I am a professional graduate..I am passionate about Latest Technology.
This entry was posted in angularjs, Uncategorized and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s