Trending News
Home / Web Development / Angular Js / AngularJS First Application

AngularJS First Application

Hi all,
Here I explain simple HelloWorld application using AngularJS.
Before I start with creating actual HelloWorld application,let us see the actual parts of a AngularJS application.AngularJS application consists of three important parts they are:




ng-app : This directive defines and links an AngularJS application to HTML.

ng-model : This directive binds the values of AngularJS application data to HTML input controls.

ng-bind : This directive bidns the AngularJS Application data to HTML tags.

Steps to create AngularJS Application

Step 1: Load framework
Load the framework using tag.Like:

<acript src=”http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js”></script>





Step 2: Define AngularJS Application using ng-app directive
<div ng-app=””>

</div>
Step 3: Define a model name using ng-model directive
<p>Enter your Name: <input type=”text” ng-model=”name”></p>
<p>Hello <span ng-bind=”name”></span>!</p>

Run AngularJS Application

TTree stpes in an HTML page.

OUTPUT




firstexample

Loading Facebook Comments ...
Social Media Auto Publish Powered By : XYZScripts.com