Aspdotnet-Suresh

aspdotnet-suresh offers C#.net articles and tutorials,csharp dot net,asp.net articles and tutorials,VB.NET Articles,Gridview articles,code examples of asp.net 2.0 /3.5,AJAX,SQL Server Articles,examples of .net technologies

AngularJS Tutorial for Beginners with Hello World Example

Jun 25, 2015
Introduction

Here I will explain
AngularJS tutorial with simple hello world example or AngularJS tutorial example for beginners. AngularJS is a MVC based JavaScript  framework which is written completely using JavaScript. In AngularJS we have set of different directives which we used commonly in AngularJS application those are ng-app, ng-controller and ng-bind directives.

Description:                
  
In previous articles I explained
Angularjs show hide div on checkbox selection, Angularjs refresh div for every 1 second using interval mode, Angularjs convert number to currency format, Angularjs get dropdownlist selected value, Angularjs convert text to uppercase while typing and many articles relating to AngularJS, jQuery, JavaScript and asp.net. Now I will explain AngularJS tutorial with simple hello world example.

In AngularJS we have common directives or properties for each application those are

ng-app: This directive is used in AngularJS to define starting of application.

ng-controller: This directive is used to control AngularJS application. Generally we will use one
controller for one AngularJS application.

ng-model: This directive is used to bind value of input field to application variable name.

Generally syntax of AngularJS application will be like as shown below


<div ng-app="" ng-controller="">
<label>Name:</label>
<input type="text" ng-model="txtname" placeholder="Please enter name">
<hr>
<h1>Hello {{txtname}}!</h1>
</div>

Simple Hello World Program

If you want to check it in complete example you need to write the code like as shown below


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>AngularJS Tutorial and Hello World Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
</head>
<body>
<form id="form1">
<div ng-app="" >
<label>Name:</label>
<input type="text" ng-model="txtname" placeholder="Please enter name">
<hr>
<h1>Hello {{txtname}}!</h1>
</div>
</form>
</body>
</html>

Live Demo

For live demo enter your name to check



Hello {{txtname}}!


If you enjoyed this post, please support the blog below. It's FREE!

Get the latest Asp.net, C#.net, VB.NET, jQuery, Plugins & Code Snippets for FREE by subscribing to our Facebook, Twitter, RSS feed, or by email.

subscribe by rss Subscribe by RSS subscribe by email Subscribe by Email

0 comments :

Give your Valuable Comments

Note: Only a member of this blog may post a comment.

© 2015 Aspdotnet-Suresh.com. All Rights Reserved.
The content is copyrighted to Suresh Dasari and may not be reproduced on other websites without permission from the owner.