2
Most read
3
Most read
12
Most read
ANGULARJS
Introduction
• AngularJS is a JavaScript framework. It
can be added to an HTML page with a
<script> tag.
• AngularJS extends HTML attributes
with Directives, and binds data to HTML
with Expressions.
• <script
src="https://ajax.googleapis.com/ajax/libs/angul
arjs/1.4.8/angular.min.js">
</script>
AngularJS Extends HTML
• AngularJS extends HTML with ng-directives.
• The ng-app directive defines an AngularJS
application.
• The ng-model directive binds the value of
HTML controls (input, select, textarea) to
application data.
• The ng-bind directive binds application data to
the HTML view.
Demo
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angu
larjs/1.4.8/angular.min.js">
</script>
<body>
<div ng-app="">
<p>Name: <input type="text" ng-model="name"></p>
<p ng-bind="name"></p>
</div>
</body>
</html>
AngularJS Directives
• The ng-init directive initializes AngularJS
application variables.
Example:-
<div ng-app="" ng-init="firstName='John'">
<p>The name is
<span bind="firstName"></span>
</p>
</div>
AngularJS Expressions
• AngularJS expressions are written inside
double braces: {{ expression }}.
• AngularJS will "output" data exactly where the
expression is written.
Example:-
<div ng-app="">
<p>My first expression: {{ 5 + 5 }}</p>
</div>
AngularJS Applications
• AngularJS modules define AngularJS
applications.
• AngularJS controllers control AngularJS
applications.
• The ng-app directive defines the application,
the ng-controller directive defines the
controller.
Demo
• <div ng-app="myApp" ng-controller="myCtrl">
First Name: <input type="text" ng-model="firstName"><br>
Last Name: <input type="text" ng-model="lastName"><br>
<br>
Full Name: {{firstName + " " + lastName}}
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.firstName= "John";
$scope.lastName= "Doe";
});
</script>
AngularJS Filters
• currency: Format a number to a currency
format.
• date: Format a date to a specified format.
• filter: Select a subset of items from an array.
• json: Format an object to a JSON string.
• lowercase: Format a string to lower case.
• uppercase: Format a string to upper case.
Adding Filters to Expressions
• Filters can be added to expressions by using the
pipe character |, followed by a filter.
Example:
<div ng-
app="myApp" ngcontroller="personCtrl">
<p>The name is {{ 1+2 | currency }}</p>
</div>
Events
• ng-click
• ng-mouseover
• ng-dblclick
• ng-change
• ng-paste
• ng-mousemove
Example of ng-mouseover:
<div ng-app="myApp" ng-controller="myCtrl">
<h1 ng-mousemover="count = count + 1">Mouse Over Me!</h1>
<h2>{{ count }}</h2>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.count = 0;
});
</script>
Shopping Cart App
Step 1:create a list of item
<script>
var app = angular.module("myShoppingList", []);
app.controller("myCtrl", function($scope) {
$scope.products = ["Mobile", "Lappy", "Tablet"];
});
</script>
<div ng-app="myShoppingList" ng-controller="myCtrl">
<ul>
<li ng-repeat="x in products">{{x}}</li>
</ul>
</div>
Step 2: Adding an item to the List
<script>
var app = angular.module("myShoppingList", []);
app.controller("myCtrl", function($scope) {
$scope.products = ["Mobile", “Lappy, “Tablet];
$scope.addItem = function () {
$scope.products.push($scope.addMe);
}
});
</script>
<div ng-app="myShoppingList" ng-controller="myCtrl">
<ul>
<li ng-repeat="x in products">{{x}}</li>
</ul>
<input ng-model="addMe">
<button ng-click="addItem()">Add</button>
</div>
Step 3: Removing an item
<script>
var app = angular.module("myShoppingList", []);
app.controller("myCtrl", function($scope) {
$scope.products = ["Mobile", “Lappy", “Tablet"];
$scope.addItem = function () {
$scope.products.push($scope.addMe);
}
$scope.removeItem = function (x) {
$scope.products.splice(x, 1);
}
});
</script>
<div ng-app="myShoppingList" ng-controller="myCtrl">
<ul>
<li ng-repeat="x in products">{{x}}<span ng-click="removeItem($index)">×</span></li>
</ul>
<input ng-model="addMe">
<button ng-click="addItem()">Add</button>
</div>

More Related Content

PPTX
Introduction to AngularJS
PPTX
Introduction to Angularjs
PPTX
Angularjs PPT
PPTX
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
PDF
Angular - Chapter 3 - Components
PPTX
JavaScript
PPTX
Angular 9
Introduction to AngularJS
Introduction to Angularjs
Angularjs PPT
Unit 1 - TypeScript & Introduction to Angular CLI.pptx
Angular - Chapter 3 - Components
JavaScript
Angular 9

What's hot (20)

PDF
Angular - Chapter 7 - HTTP Services
PDF
JavaScript - Chapter 11 - Events
PPTX
Angular Data Binding
PPT
Angular Introduction By Surekha Gadkari
PPT
Js ppt
PPTX
Typescript ppt
PDF
javascript objects
PPTX
Introduction to angular with a simple but complete project
PDF
Angular Observables & RxJS Introduction
PPTX
[Final] ReactJS presentation
PPTX
Introduction to React JS
PPT
SQLITE Android
PPTX
Ajax presentation
PDF
JavaScript - Chapter 12 - Document Object Model
PPTX
An Introduction To REST API
PPTX
Getting started with typescript
PDF
jQuery for beginners
PDF
TypeScript - An Introduction
PDF
Angular
Angular - Chapter 7 - HTTP Services
JavaScript - Chapter 11 - Events
Angular Data Binding
Angular Introduction By Surekha Gadkari
Js ppt
Typescript ppt
javascript objects
Introduction to angular with a simple but complete project
Angular Observables & RxJS Introduction
[Final] ReactJS presentation
Introduction to React JS
SQLITE Android
Ajax presentation
JavaScript - Chapter 12 - Document Object Model
An Introduction To REST API
Getting started with typescript
jQuery for beginners
TypeScript - An Introduction
Angular
Ad

Similar to Angular js PPT (20)

DOCX
Angular js
PDF
Workshop 12: AngularJS Parte I
PDF
Wt unit 5 client &amp; server side framework
PPTX
ANGULARJS introduction components services and directives
PPTX
Angular js
PPTX
Angular.pptx
PDF
Introduction to AngularJS By Bharat Makwana
PDF
Introduction to AngularJS
PPTX
AngularJS
PPTX
Kalp Corporate Angular Js Tutorials
PPTX
Angular js
PPTX
Angularjs
PPTX
Angular workshop - Full Development Guide
PPTX
Angular
PPTX
Angular
PDF
AngularJS Basics
PPTX
Angular Javascript Tutorial with command
PDF
Dive into AngularJS and directives
PPTX
AngularJs Basic Concept
Angular js
Workshop 12: AngularJS Parte I
Wt unit 5 client &amp; server side framework
ANGULARJS introduction components services and directives
Angular js
Angular.pptx
Introduction to AngularJS By Bharat Makwana
Introduction to AngularJS
AngularJS
Kalp Corporate Angular Js Tutorials
Angular js
Angularjs
Angular workshop - Full Development Guide
Angular
Angular
AngularJS Basics
Angular Javascript Tutorial with command
Dive into AngularJS and directives
AngularJs Basic Concept
Ad

More from Imtiyaz Ahmad Khan (6)

PDF
RAILWAY SUMMER TRAINING REPORT
PDF
Gorakhpur railway summer training report
PPTX
Android presentation
PDF
DOCX
Quiz bigdata
PPTX
Summer training ppt
RAILWAY SUMMER TRAINING REPORT
Gorakhpur railway summer training report
Android presentation
Quiz bigdata
Summer training ppt

Recently uploaded (20)

PDF
BÀI GIẢNG POWER POINT TIẾNG ANH 6 - I LEARN SMART WORLD - CẢ NĂM - NĂM 2025 (...
DOCX
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
PDF
New_Round_Up_6_SB.pdf download for free, easy to learn
PDF
IS1343_2012...........................pdf
PDF
BA-1ST(Education)-Education and Society.pdf
PDF
Financial Reporting and Analysis Using Financial Accounting Information by Ch...
PPTX
Entrepreneurship Management and Finance - Module 1 - PPT
PDF
Teacher's Day Quiz 2025
PPTX
chapter-1-221011141445-58f8b864sdfghj.pptx
PPTX
CHF refers to the condition wherein heart unable to pump a sufficient amount ...
PDF
gsas-cvs-and-cover-letters jhvgfcffttfghgvhg.pdf
PDF
Jana Ojana 2025 Prelims - School Quiz by Pragya - UEMK Quiz Club
PDF
English 2nd semesteNotesh biology biopsy results from the other day and I jus...
PDF
BA-1ST(Education)-Education and Society.pdf
PDF
2003-theological-education-v39-n1-tai lieu
PDF
Bacterial Diversity and Evolution Bacterial Taxonomy Lecture (4)_.pdf
PDF
Developing speaking skill_learning_mater.pdf
DOCX
OA 7- Administrative Office Procedure and Management.docx
PDF
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
PDF
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
BÀI GIẢNG POWER POINT TIẾNG ANH 6 - I LEARN SMART WORLD - CẢ NĂM - NĂM 2025 (...
HELMET DETECTION AND BIOMETRIC BASED VEHICLESECURITY USING MACHINE LEARNING.docx
New_Round_Up_6_SB.pdf download for free, easy to learn
IS1343_2012...........................pdf
BA-1ST(Education)-Education and Society.pdf
Financial Reporting and Analysis Using Financial Accounting Information by Ch...
Entrepreneurship Management and Finance - Module 1 - PPT
Teacher's Day Quiz 2025
chapter-1-221011141445-58f8b864sdfghj.pptx
CHF refers to the condition wherein heart unable to pump a sufficient amount ...
gsas-cvs-and-cover-letters jhvgfcffttfghgvhg.pdf
Jana Ojana 2025 Prelims - School Quiz by Pragya - UEMK Quiz Club
English 2nd semesteNotesh biology biopsy results from the other day and I jus...
BA-1ST(Education)-Education and Society.pdf
2003-theological-education-v39-n1-tai lieu
Bacterial Diversity and Evolution Bacterial Taxonomy Lecture (4)_.pdf
Developing speaking skill_learning_mater.pdf
OA 7- Administrative Office Procedure and Management.docx
HSE 2022-2023.pdf الصحه والسلامه هندسه نفط
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf

Angular js PPT

  • 2. Introduction • AngularJS is a JavaScript framework. It can be added to an HTML page with a <script> tag. • AngularJS extends HTML attributes with Directives, and binds data to HTML with Expressions. • <script src="https://ajax.googleapis.com/ajax/libs/angul arjs/1.4.8/angular.min.js"> </script>
  • 3. AngularJS Extends HTML • AngularJS extends HTML with ng-directives. • The ng-app directive defines an AngularJS application. • The ng-model directive binds the value of HTML controls (input, select, textarea) to application data. • The ng-bind directive binds application data to the HTML view.
  • 5. AngularJS Directives • The ng-init directive initializes AngularJS application variables. Example:- <div ng-app="" ng-init="firstName='John'"> <p>The name is <span bind="firstName"></span> </p> </div>
  • 6. AngularJS Expressions • AngularJS expressions are written inside double braces: {{ expression }}. • AngularJS will "output" data exactly where the expression is written. Example:- <div ng-app=""> <p>My first expression: {{ 5 + 5 }}</p> </div>
  • 7. AngularJS Applications • AngularJS modules define AngularJS applications. • AngularJS controllers control AngularJS applications. • The ng-app directive defines the application, the ng-controller directive defines the controller.
  • 8. Demo • <div ng-app="myApp" ng-controller="myCtrl"> First Name: <input type="text" ng-model="firstName"><br> Last Name: <input type="text" ng-model="lastName"><br> <br> Full Name: {{firstName + " " + lastName}} </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.firstName= "John"; $scope.lastName= "Doe"; }); </script>
  • 9. AngularJS Filters • currency: Format a number to a currency format. • date: Format a date to a specified format. • filter: Select a subset of items from an array. • json: Format an object to a JSON string. • lowercase: Format a string to lower case. • uppercase: Format a string to upper case.
  • 10. Adding Filters to Expressions • Filters can be added to expressions by using the pipe character |, followed by a filter. Example: <div ng- app="myApp" ngcontroller="personCtrl"> <p>The name is {{ 1+2 | currency }}</p> </div>
  • 11. Events • ng-click • ng-mouseover • ng-dblclick • ng-change • ng-paste • ng-mousemove
  • 12. Example of ng-mouseover: <div ng-app="myApp" ng-controller="myCtrl"> <h1 ng-mousemover="count = count + 1">Mouse Over Me!</h1> <h2>{{ count }}</h2> </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.count = 0; }); </script>
  • 13. Shopping Cart App Step 1:create a list of item <script> var app = angular.module("myShoppingList", []); app.controller("myCtrl", function($scope) { $scope.products = ["Mobile", "Lappy", "Tablet"]; }); </script> <div ng-app="myShoppingList" ng-controller="myCtrl"> <ul> <li ng-repeat="x in products">{{x}}</li> </ul> </div>
  • 14. Step 2: Adding an item to the List <script> var app = angular.module("myShoppingList", []); app.controller("myCtrl", function($scope) { $scope.products = ["Mobile", “Lappy, “Tablet]; $scope.addItem = function () { $scope.products.push($scope.addMe); } }); </script> <div ng-app="myShoppingList" ng-controller="myCtrl"> <ul> <li ng-repeat="x in products">{{x}}</li> </ul> <input ng-model="addMe"> <button ng-click="addItem()">Add</button> </div>
  • 15. Step 3: Removing an item <script> var app = angular.module("myShoppingList", []); app.controller("myCtrl", function($scope) { $scope.products = ["Mobile", “Lappy", “Tablet"]; $scope.addItem = function () { $scope.products.push($scope.addMe); } $scope.removeItem = function (x) { $scope.products.splice(x, 1); } }); </script> <div ng-app="myShoppingList" ng-controller="myCtrl"> <ul> <li ng-repeat="x in products">{{x}}<span ng-click="removeItem($index)">×</span></li> </ul> <input ng-model="addMe"> <button ng-click="addItem()">Add</button> </div>