SlideShare a Scribd company logo
ANGULAR JS
Anisha
INTRODUCTION
• Angular JS is a JavaScript.
• Added to an HTML page with a <script> tag.
• Extends HTML attributes with Directives.
• Binds data with Expressions.
• Used in Single Page Application (SPA) projects.

CORE FEATURES
WHY USE ANGULAR JS???
 Data-binding
 Dependency Injection
 MVC Framework
 Two-way data binding
 SPA(Single Page Application)
Example of Two Way Data Binding:
TWO WAY DATA BINDING
DIRECTIVE
Today’s HTML Component
ANGULARJS COMPONENTS/ DIRECTIVE
• ng-app − This directive initializes an AngularJS
application.
<div ng-app="">
• ng-model − This directive binds the values of AngularJS
application data to HTML input controls (input, select,
textarea) of our application .
ng-model="name"
• ng-bind − This directive binds the AngularJS
Application data to HTML tags.
ng-bind="name"
MODEL
The structure of your Application
NG-MODEL DIRECTIVE
 ng-model directive you can bind the value of an
input field to a variable created in AngularJS.
 Example:
<div ng-app="myApp" ng-controller="myCtrl">
Name: <input ng-model="name">
</div>
NG-BIND DIRECTIVE
 ng-bind directive, which will bind the innerHTML of
the element to the specified model property
 Example:
<p ng-bind="firstname"></p>
</div>
<div ng-app="myApp" ng-controller="myCtrl">
<p ng-bind="name"></p>
</div>
NG-REPEAT DIRECTIVE
 The ng-repeat directive repeats a set of HTML, a given
number of times.
 Syntax:
<element ng-repeat="expression"></element>
 Legal Expression examples:
x in records
(key, value) in myObj
Example:
<TR NG-REPEAT="X IN RECORDS">
<TD>{{X.NAME}}</TD>
<TD>{{X.COUNTRY}}</TD>
</TR>
<SCRIPT>
VAR APP = ANGULAR.MODULE("MYAPP", []);
APP.CONTROLLER("MYCTRL", FUNCTION($SCOPE) {
$SCOPE.RECORDS = [
{
"NAME" : "ALFREDS FUTTERKISTE",
"COUNTRY" : "GERMANY"
}, {
"NAME" : "BERGLUNDS SNABBKÖP",
"COUNTRY" : "SWEDEN"
} ]
});
</SCRIPT>
<TABLE NG-CONTROLLER="MYCTRL" BORDER="1">
<TR NG-REPEAT="(X, Y) IN MYOBJ">
<TD>{{X}}</TD>
<TD>{{Y}}</TD>
</TR>
</TABLE>
<SCRIPT>
VAR APP = ANGULAR.MODULE("MYAPP", []);
APP.CONTROLLER("MYCTRL", FUNCTION($SCOPE) {
$SCOPE.MYOBJ = {
"NAME" : "ALFREDS FUTTERKISTE",
"COUNTRY" : "GERMANY",
"CITY" : "BERLIN"
}
});
</SCRIPT>
EXPRESSIONS
Bind your Data anywhere in the page
ANGULARJS EXPRESSIONS
 AngularJS binds data to HTML
using Expressions.
 AngularJS expressions can be written inside
double braces: {{ expression }}.
 AngularJS expressions can also be written
inside a directive: ng-bind="expression".
My first expression: {{ 5 + 5 }}
ANGULARJS MODULES
 An AngularJS module defines an application.
 The module is a container for the application
controllers.
 A module is created by using the AngularJS
function angular.module
 Example:
<div ng-app="myApp">...</div>
<script>
var app = angular.module("myApp", []);
</script>
<div ng-app="myApp">...</div>
<script>
var app = angular.module("myApp", []);
</script>
CONTROLLERS
Data provider for our view
ANGULARJS CONTROLLERS
 AngularJS applications are controlled by controllers. They act as
containers.
 The ng-controller directive defines the application controller.
 Example:
<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>
<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>
CONTROLLERS IN EXTERNAL FILES
 In larger applications, it is common to store
controllers in external files.
 Example:
<div ng-app="myApp" ng-
controller="personCtrl">
First Name: <input type="text" ng-
model="firstName"><br>
Last Name: <input type="text" ng-
model="lastName"><br>
<br>
Full Name: {{fullName()}}
</div>
<script src="personController.js"></script>
<div ng-app="myApp" ng-controller="personCtrl">
First Name: <input type="text" ng-
model="firstName"><br>
Last Name: <input type="text" ng-
model="lastName"><br>
<br>
Full Name: {{fullName()}}
</div>
<script src="personController.js"></script>
PERSONCONTROLLER.JS
 app.controller('personCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
$scope.fullName = function() {
return $scope.firstName + " " +
$scope.lastName;
};
app.controller('personCtrl', function($scope) {
$scope.firstName = "John";
$scope.lastName = "Doe";
$scope.fullName = function() {
return $scope.firstName + " " +
$scope.lastName;
};
ANGULARJS SCOPE
 The scope is the binding part between the HTML (view)
and the JavaScript (controller).
 Example:
<div ng-app="myApp" ng-
controller="myCtrl">
<h1>{{carname}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.carname = "Volvo";
});
</script>
<div ng-app="myApp" ng-controller="myCtrl">
<h1>{{carname}}</h1>
</div>
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope) {
$scope.carname = "Volvo";
});
</script>
SERVICES
Utility component of our Application
ANGULARJS SERVICES
 $http Service
 The service makes a request to the server, and lets your
application handle the response.
 Example:
$http.get("welcome.htm").then(function (resp
onse) {
$scope.myWelcome = response.data;
});
});
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http)
{
$http.get("welcome.htm").then(function (response) {
$scope.myWelcome = response.data;
});
});
$TIMEOUT SERVICE
 $timeout Service
o The $timeout service is AngularJS' version of
the window.setTimeout function.
o Example:
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope,
$timeout) {
$scope.myHeader = "Hello World!";
$timeout(function () {
$scope.myHeader = "How are you today?";
}, 2000);
});
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope,
$timeout) {
$scope.myHeader = "Hello World!";
$timeout(function () {
$scope.myHeader = "How are you today?";
}, 2000);
});
FILTERS
Change the way your expressions are displayed
UPPERCASE FILTER
 Syntax:
{{student.fullName() | uppercase}}
LOWERCASE FILTER
 Syntax:
{{student.fullName() | lowercase}}
ORDERBY FILTER
 Syntax:
<li ng-repeat = "subject in student.subjects |
orderBy:'marks'">
DEMO LOGIN FORM
PROJECT STRUCTURE
SPA WITH CRUD OPERATION
Angular js
Angular js
THANK YOU

More Related Content

What's hot (20)

Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
Imtiyaz Ahmad Khan
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
Phan Tuan
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
Gabi Costel Lapusneanu
 
Angular js 1.0-fundamentals
Angular js 1.0-fundamentalsAngular js 1.0-fundamentals
Angular js 1.0-fundamentals
Venkatesh Narayanan
 
Angular from Scratch
Angular from ScratchAngular from Scratch
Angular from Scratch
Christian Lilley
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
Akshay Mathur
 
Dive into Angular, part 1: Introduction
Dive into Angular, part 1: IntroductionDive into Angular, part 1: Introduction
Dive into Angular, part 1: Introduction
Oleksii Prohonnyi
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
Munir Hoque
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Betclic Everest Group Tech Team
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
Simon Guest
 
Angular js
Angular jsAngular js
Angular js
Behind D Walls
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
Manish Shekhawat
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
Cornel Stefanache
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
Narek Mamikonyan
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
cncwebworld
 
Directives
DirectivesDirectives
Directives
Brajesh Yadav
 
Angular JS
Angular JSAngular JS
Angular JS
John Temoty Roca
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
David Parsons
 
Controller in AngularJS
Controller in AngularJSController in AngularJS
Controller in AngularJS
Brajesh Yadav
 

Viewers also liked (15)

Angular js
Angular jsAngular js
Angular js
Manav Prasad
 
Design patterns through refactoring
Design patterns through refactoringDesign patterns through refactoring
Design patterns through refactoring
Ganesh Samarthyam
 
Design Patterns in .Net
Design Patterns in .NetDesign Patterns in .Net
Design Patterns in .Net
Dmitri Nesteruk
 
Creational Design Patterns
Creational Design PatternsCreational Design Patterns
Creational Design Patterns
Jamie (Taka) Wang
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
Claude Tech
 
Node js meetup
Node js meetupNode js meetup
Node js meetup
Ansuman Roy
 
Get satrted angular js
Get satrted angular jsGet satrted angular js
Get satrted angular js
Alexandre Marreiros
 
Angular 2
Angular 2Angular 2
Angular 2
Nigam Goyal
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Object-oriented design patterns in UML [Software Modeling] [Computer Science...
Object-oriented design patterns  in UML [Software Modeling] [Computer Science...Object-oriented design patterns  in UML [Software Modeling] [Computer Science...
Object-oriented design patterns in UML [Software Modeling] [Computer Science...
Ivano Malavolta
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
soms_1
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
Ryan Anklam
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Svetlin Nakov
 
Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)Design Patterns (Examples in .NET)
Design Patterns (Examples in .NET)
Aniruddha Chakrabarti
 
Design Patterns Illustrated
Design Patterns IllustratedDesign Patterns Illustrated
Design Patterns Illustrated
Herman Peeren
 
Design patterns through refactoring
Design patterns through refactoringDesign patterns through refactoring
Design patterns through refactoring
Ganesh Samarthyam
 
Angular JS blog tutorial
Angular JS blog tutorialAngular JS blog tutorial
Angular JS blog tutorial
Claude Tech
 
Introduction to Node js
Introduction to Node jsIntroduction to Node js
Introduction to Node js
Akshay Mathur
 
Object-oriented design patterns in UML [Software Modeling] [Computer Science...
Object-oriented design patterns  in UML [Software Modeling] [Computer Science...Object-oriented design patterns  in UML [Software Modeling] [Computer Science...
Object-oriented design patterns in UML [Software Modeling] [Computer Science...
Ivano Malavolta
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
soms_1
 
Modern UI Development With Node.js
Modern UI Development With Node.jsModern UI Development With Node.js
Modern UI Development With Node.js
Ryan Anklam
 
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Architectural Patterns and Software Architectures: Client-Server, Multi-Tier,...
Svetlin Nakov
 
Design Patterns Illustrated
Design Patterns IllustratedDesign Patterns Illustrated
Design Patterns Illustrated
Herman Peeren
 
Ad

Similar to Angular js (20)

Wt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side frameworkWt unit 5 client &amp; server side framework
Wt unit 5 client &amp; server side framework
PUNE VIDYARTHI GRIHA'S COLLEGE OF ENGINEERING, NASHIK
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
Angularjs
AngularjsAngularjs
Angularjs
Sabin Tamrakar
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
Visual Engineering
 
Dive into AngularJS and directives
Dive into AngularJS and directivesDive into AngularJS and directives
Dive into AngularJS and directives
Tricode (part of Dept)
 
AngularJs
AngularJsAngularJs
AngularJs
syam kumar kk
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js Tutorials
Kalp Corporate
 
ANGULARJS introduction components services and directives
ANGULARJS   introduction components services and directivesANGULARJS   introduction components services and directives
ANGULARJS introduction components services and directives
SanthoshB77
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
Yashobanta Bai
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
Nitin Giri
 
ANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNE
cncwebworld
 
Angular js
Angular jsAngular js
Angular js
prasaddammalapati
 
Introduction to AngularJS By Bharat Makwana
Introduction to AngularJS By Bharat MakwanaIntroduction to AngularJS By Bharat Makwana
Introduction to AngularJS By Bharat Makwana
Bharat Makwana
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
Filip Janevski
 
AngularJS
AngularJSAngularJS
AngularJS
LearningTech
 
Angular Javascript Tutorial with command
Angular Javascript Tutorial with commandAngular Javascript Tutorial with command
Angular Javascript Tutorial with command
ssuser42b933
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
Hari Haran
 
Angular Presentation
Angular PresentationAngular Presentation
Angular Presentation
Adam Moore
 
Angular js
Angular jsAngular js
Angular js
Ramakrishna kapa
 
Angular js
Angular jsAngular js
Angular js
Silver Touch Technologies Ltd
 
Ad

Recently uploaded (20)

ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdfICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
M. Luisetto Pharm.D.Spec. Pharmacology
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan
OnePlan Solutions
 
zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17
zOSCommserver
 
SQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptxSQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptx
Ashlei5
 
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjaraswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
muhammadalikhanalikh1
 
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Prachi Desai
 
How John started to like TDD (instead of hating it) (ViennaJUG, June'25)
How John started to like TDD (instead of hating it) (ViennaJUG, June'25)How John started to like TDD (instead of hating it) (ViennaJUG, June'25)
How John started to like TDD (instead of hating it) (ViennaJUG, June'25)
Nacho Cougil
 
Optimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing SystemsOptimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing Systems
Insurance Tech Services
 
Software Risk and Quality management.pptx
Software Risk and Quality management.pptxSoftware Risk and Quality management.pptx
Software Risk and Quality management.pptx
HassanBangash9
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
Philip Schwarz
 
Content Mate Web App Triples Content Managers‘ Productivity
Content Mate Web App Triples Content Managers‘ ProductivityContent Mate Web App Triples Content Managers‘ Productivity
Content Mate Web App Triples Content Managers‘ Productivity
Alex Vladimirovich
 
Design by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First DevelopmentDesign by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First Development
Par-Tec S.p.A.
 
Custom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdfCustom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdf
Digital Aptech
 
Issues in AI Presentation and machine learning.pptx
Issues in AI Presentation and machine learning.pptxIssues in AI Presentation and machine learning.pptx
Issues in AI Presentation and machine learning.pptx
Jalalkhan657136
 
Scalefusion Remote Access for Apple Devices
Scalefusion Remote Access for Apple DevicesScalefusion Remote Access for Apple Devices
Scalefusion Remote Access for Apple Devices
Scalefusion
 
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdfSecure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Northwind Technologies
 
Topic 26 Security Testing Considerations.pptx
Topic 26 Security Testing Considerations.pptxTopic 26 Security Testing Considerations.pptx
Topic 26 Security Testing Considerations.pptx
marutnand8
 
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdfHow to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
victordsane
 
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdfICDL FULL STANDARD  2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
ICDL FULL STANDARD 2025 Luisetto mauro - Academia domani- 55 HOURS LONG pdf
M. Luisetto Pharm.D.Spec. Pharmacology
 
Shortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome ThemShortcomings of EHS Software – And How to Overcome Them
Shortcomings of EHS Software – And How to Overcome Them
TECH EHS Solution
 
Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan Delivering More with Less: AI Driven Resource Management with OnePlan
Delivering More with Less: AI Driven Resource Management with OnePlan
OnePlan Solutions
 
zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17zOS CommServer support for the Network Express feature on z17
zOS CommServer support for the Network Express feature on z17
zOSCommserver
 
SQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptxSQL-COMMANDS instructionsssssssssss.pptx
SQL-COMMANDS instructionsssssssssss.pptx
Ashlei5
 
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjaraswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
aswjkdwelhjdfshlfjkhewljhfljawerhwjarhwjkahrjar
muhammadalikhanalikh1
 
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Why Indonesia’s $12.63B Alt-Lending Boom Needs Loan Servicing Automation & Re...
Prachi Desai
 
How John started to like TDD (instead of hating it) (ViennaJUG, June'25)
How John started to like TDD (instead of hating it) (ViennaJUG, June'25)How John started to like TDD (instead of hating it) (ViennaJUG, June'25)
How John started to like TDD (instead of hating it) (ViennaJUG, June'25)
Nacho Cougil
 
Optimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing SystemsOptimising Claims Management with Claims Processing Systems
Optimising Claims Management with Claims Processing Systems
Insurance Tech Services
 
Software Risk and Quality management.pptx
Software Risk and Quality management.pptxSoftware Risk and Quality management.pptx
Software Risk and Quality management.pptx
HassanBangash9
 
Techdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk takerTechdebt handling with cleancode focus and as risk taker
Techdebt handling with cleancode focus and as risk taker
RajaNagendraKumar
 
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
List Unfolding - 'unfold' as the Computational Dual of 'fold', and how 'unfol...
Philip Schwarz
 
Content Mate Web App Triples Content Managers‘ Productivity
Content Mate Web App Triples Content Managers‘ ProductivityContent Mate Web App Triples Content Managers‘ Productivity
Content Mate Web App Triples Content Managers‘ Productivity
Alex Vladimirovich
 
Design by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First DevelopmentDesign by Contract - Building Robust Software with Contract-First Development
Design by Contract - Building Robust Software with Contract-First Development
Par-Tec S.p.A.
 
Custom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdfCustom Software Development: Types, Applications and Benefits.pdf
Custom Software Development: Types, Applications and Benefits.pdf
Digital Aptech
 
Issues in AI Presentation and machine learning.pptx
Issues in AI Presentation and machine learning.pptxIssues in AI Presentation and machine learning.pptx
Issues in AI Presentation and machine learning.pptx
Jalalkhan657136
 
Scalefusion Remote Access for Apple Devices
Scalefusion Remote Access for Apple DevicesScalefusion Remote Access for Apple Devices
Scalefusion Remote Access for Apple Devices
Scalefusion
 
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdfSecure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Secure and Simplify IT Management with ManageEngine Endpoint Central.pdf
Northwind Technologies
 
Topic 26 Security Testing Considerations.pptx
Topic 26 Security Testing Considerations.pptxTopic 26 Security Testing Considerations.pptx
Topic 26 Security Testing Considerations.pptx
marutnand8
 
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdfHow to purchase, license and subscribe to Microsoft Azure_PDF.pdf
How to purchase, license and subscribe to Microsoft Azure_PDF.pdf
victordsane
 

Angular js

  • 2. INTRODUCTION • Angular JS is a JavaScript. • Added to an HTML page with a <script> tag. • Extends HTML attributes with Directives. • Binds data with Expressions. • Used in Single Page Application (SPA) projects. 
  • 4. WHY USE ANGULAR JS???  Data-binding  Dependency Injection  MVC Framework  Two-way data binding  SPA(Single Page Application)
  • 5. Example of Two Way Data Binding:
  • 6. TWO WAY DATA BINDING
  • 8. ANGULARJS COMPONENTS/ DIRECTIVE • ng-app − This directive initializes an AngularJS application. <div ng-app=""> • ng-model − This directive binds the values of AngularJS application data to HTML input controls (input, select, textarea) of our application . ng-model="name" • ng-bind − This directive binds the AngularJS Application data to HTML tags. ng-bind="name"
  • 9. MODEL The structure of your Application
  • 10. NG-MODEL DIRECTIVE  ng-model directive you can bind the value of an input field to a variable created in AngularJS.  Example: <div ng-app="myApp" ng-controller="myCtrl"> Name: <input ng-model="name"> </div>
  • 11. NG-BIND DIRECTIVE  ng-bind directive, which will bind the innerHTML of the element to the specified model property  Example: <p ng-bind="firstname"></p> </div> <div ng-app="myApp" ng-controller="myCtrl"> <p ng-bind="name"></p> </div>
  • 12. NG-REPEAT DIRECTIVE  The ng-repeat directive repeats a set of HTML, a given number of times.  Syntax: <element ng-repeat="expression"></element>  Legal Expression examples: x in records (key, value) in myObj Example:
  • 13. <TR NG-REPEAT="X IN RECORDS"> <TD>{{X.NAME}}</TD> <TD>{{X.COUNTRY}}</TD> </TR> <SCRIPT> VAR APP = ANGULAR.MODULE("MYAPP", []); APP.CONTROLLER("MYCTRL", FUNCTION($SCOPE) { $SCOPE.RECORDS = [ { "NAME" : "ALFREDS FUTTERKISTE", "COUNTRY" : "GERMANY" }, { "NAME" : "BERGLUNDS SNABBKÖP", "COUNTRY" : "SWEDEN" } ] }); </SCRIPT>
  • 14. <TABLE NG-CONTROLLER="MYCTRL" BORDER="1"> <TR NG-REPEAT="(X, Y) IN MYOBJ"> <TD>{{X}}</TD> <TD>{{Y}}</TD> </TR> </TABLE> <SCRIPT> VAR APP = ANGULAR.MODULE("MYAPP", []); APP.CONTROLLER("MYCTRL", FUNCTION($SCOPE) { $SCOPE.MYOBJ = { "NAME" : "ALFREDS FUTTERKISTE", "COUNTRY" : "GERMANY", "CITY" : "BERLIN" } }); </SCRIPT>
  • 15. EXPRESSIONS Bind your Data anywhere in the page
  • 16. ANGULARJS EXPRESSIONS  AngularJS binds data to HTML using Expressions.  AngularJS expressions can be written inside double braces: {{ expression }}.  AngularJS expressions can also be written inside a directive: ng-bind="expression". My first expression: {{ 5 + 5 }}
  • 17. ANGULARJS MODULES  An AngularJS module defines an application.  The module is a container for the application controllers.  A module is created by using the AngularJS function angular.module  Example: <div ng-app="myApp">...</div> <script> var app = angular.module("myApp", []); </script> <div ng-app="myApp">...</div> <script> var app = angular.module("myApp", []); </script>
  • 19. ANGULARJS CONTROLLERS  AngularJS applications are controlled by controllers. They act as containers.  The ng-controller directive defines the application controller.  Example: <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> <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>
  • 20. CONTROLLERS IN EXTERNAL FILES  In larger applications, it is common to store controllers in external files.  Example: <div ng-app="myApp" ng- controller="personCtrl"> First Name: <input type="text" ng- model="firstName"><br> Last Name: <input type="text" ng- model="lastName"><br> <br> Full Name: {{fullName()}} </div> <script src="personController.js"></script> <div ng-app="myApp" ng-controller="personCtrl"> First Name: <input type="text" ng- model="firstName"><br> Last Name: <input type="text" ng- model="lastName"><br> <br> Full Name: {{fullName()}} </div> <script src="personController.js"></script>
  • 21. PERSONCONTROLLER.JS  app.controller('personCtrl', function($scope) { $scope.firstName = "John"; $scope.lastName = "Doe"; $scope.fullName = function() { return $scope.firstName + " " + $scope.lastName; }; app.controller('personCtrl', function($scope) { $scope.firstName = "John"; $scope.lastName = "Doe"; $scope.fullName = function() { return $scope.firstName + " " + $scope.lastName; };
  • 22. ANGULARJS SCOPE  The scope is the binding part between the HTML (view) and the JavaScript (controller).  Example: <div ng-app="myApp" ng- controller="myCtrl"> <h1>{{carname}}</h1> </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.carname = "Volvo"; }); </script> <div ng-app="myApp" ng-controller="myCtrl"> <h1>{{carname}}</h1> </div> <script> var app = angular.module('myApp', []); app.controller('myCtrl', function($scope) { $scope.carname = "Volvo"; }); </script>
  • 23. SERVICES Utility component of our Application
  • 24. ANGULARJS SERVICES  $http Service  The service makes a request to the server, and lets your application handle the response.  Example: $http.get("welcome.htm").then(function (resp onse) { $scope.myWelcome = response.data; }); }); var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $http) { $http.get("welcome.htm").then(function (response) { $scope.myWelcome = response.data; }); });
  • 25. $TIMEOUT SERVICE  $timeout Service o The $timeout service is AngularJS' version of the window.setTimeout function. o Example: var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $timeout) { $scope.myHeader = "Hello World!"; $timeout(function () { $scope.myHeader = "How are you today?"; }, 2000); }); var app = angular.module('myApp', []); app.controller('myCtrl', function($scope, $timeout) { $scope.myHeader = "Hello World!"; $timeout(function () { $scope.myHeader = "How are you today?"; }, 2000); });
  • 26. FILTERS Change the way your expressions are displayed
  • 27. UPPERCASE FILTER  Syntax: {{student.fullName() | uppercase}} LOWERCASE FILTER  Syntax: {{student.fullName() | lowercase}} ORDERBY FILTER  Syntax: <li ng-repeat = "subject in student.subjects | orderBy:'marks'">
  • 30. SPA WITH CRUD OPERATION