Angularjs Classroom image

shubham  rauthan / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  ||
Lessons:-AngularJS Directives

AngularJS directives are extended HTML attributes with the prefix ng-.

The ng-app directive initializes an AngularJS application.

The ng-init directive initializes application data.

The ng-model directive binds the value of HTML controls (input, select, textarea) to application data.

AngularJS Directives The AngularJS framework can be divided into three major parts:

  1. ng-app : This directive defines and links an AngularJS application to HTML.
  2. ng-model : This directive binds the values of AngularJS application data to HTML input controls.
  3. ng-bind : This directive binds the AngularJS application data to HTML tags.

Example

<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body>

<div ng-app="" ng-init="firstName='John'">

<p>Input something in the input box:</p>
<p>Name: <input type="text" ng-model="firstName"></p>
<p>You wrote: {{ firstName }}</p>

</div>

</body>
</html>

Out Put

Input something in the input box:

Name: 

Jon

You wrote: John

 
 
 
image
shubham  rauthan

Skills    Angularjs

Qualifications :-
Location :-dehradun,dehradun,uttarakhand,India
Description:-

I am a b.tech graduate in Information Technology and working as a Software Engineer and i would like to learn new technologies and up to date with the trending technologies in I.T. fields


Explore
 

  Students (0)