3. <head>
4. 5. <title>Demo for a Simple AngularJS App<title>
6. src=" />7. </head>
8. <body>
9. <script>
10. var app = angular.module("myApp",[]);
11. app.controller("myController",function($scope){
12. $scope.name = "";
13. });
14. </script>
15. </body>
16. </html>
Data Binding with $scope
Dynamic and Responsive Web Development Using AngularJS
© Aptech Limited
15 of 19
nl
y
O
Two Way Data Binding
Fo
rA
pt
ec
h
C
en
tre
U
se
An example of two way binding
Name; with two way data binding
Dynamic and Responsive Web Development Using AngularJS
© Aptech Limited
16 of 19
nl
y
O
Event Handling
U
se
Some common AngularJS event listener directives
ng-dblclick
Fo
rA
pt
ec
h
ng-keydown
ng-change
C
en
tre
ng-click
ng-keypress
ng-mouseleave
ng-mouseenter
ng-mousedown
Dynamic and Responsive Web Development Using AngularJS
© Aptech Limited
17 of 19
nl
y
1-2
O
Summary
In AngularJS, modules are the containers used to hold other
U
se
parts of an application.
C
en
tre
AngularJS applications depend on controllers to control the flow
of data in the application.
Controllers are JavaScript objects which have properties and
functions.
Fo
rA
pt
ec
h
Views are what the user gets to see in an application.
AngularJS expressions are similar to JavaScript code snippets.
Expressions can work with numbers, strings, JavaScript objects
and arrays.
Data binding in AngularJS is the bringing together of data
between the model and the view.
Dynamic and Responsive Web Development Using AngularJS
© Aptech Limited
18 of 19
nl
y
2-2
O
Summary
C
en
tre
ng-dblclick
ng-keydown
ng-keypress
ng-keyup
ng-mousedown
ng-mouseenter
ng-mouseleave
ng-change
Fo
rA
pt
ec
h
•
•
•
•
•
•
•
•
U
se
Some common AngularJS event listener directives for DOM
events are ng-click
Dynamic and Responsive Web Development Using AngularJS
© Aptech Limited
19 of 19