SlideShare a Scribd company logo
AngularJS
What is AngularJS?
AngularJS is a client-side MVC framework written in JavaScript. It
greatly helps us to write modern, single-page, Ajax-style web
applications.
Although, it is a general purpose framework, but it truly shines
when used with CRUD type applications.
Setting up AngularJS environment
Including AngularJS library
• Download from angularjs.org
• Or use one hosted on Google’s CDN network like so
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/ang
ular.min.js">
</script>
Simple Hello World application
Output
One Way Data Binding
Two Way Data Binding
Extending Hello World
Scopes
• A $scope object in AngularJS is here to expose the domain
model to a view.
• By assigning properties to scope instances, we can make new
values available to a template for rendering.
Getter Functions
<h1> Hello, {{ getName() }} </h1>
Controllers
• Controller is a JavaScript constructor function to initialize scope
objects.
• When a Controller is attached to the DOM via the ng-controller
directive, Angular will instantiate a new Controller object, using
the specified Controller's constructor function. A new child scope
will be available as an injectable parameter to the Controller's
constructor function as $scope.
Use controllers to :
• Set up the initial state of the $scope object.
• Add UI specific behavior to the $scope object.
Model
• AngularJS models are plain, old JavaScript objects.
• Any valid Javascript object or array can be passed to a model.
• To expose a model to AngularJS you simply assign it to a
$scope.
Hierarchy in scopes
• We need to have at least one instance of a scope to create a
new scope because ng-controller directive will create a new
scope using Scope.$new()
• AngularJS has a $rootScope i.e. a parent of all the scopes.
• $rootScope instance gets created when a new application is
bootstrap.
• Scopes are arranged in hierarchical structure which mimic the
DOM tree of the application.
Inheritance
Output
Fetching parent scope using $parent
Rule of thumb
Try to avoid using the $parent property as it strongly links
AngularJS expressions to the DOM structure created by your
tempaltes. An application might break as a result of simple
changes.
Alternative to $parent
Declarative template view – imperative
controller logic
• AngularJS promotes declarative approach to UI construction.
Templates are focused on describing a desired effect rather
than on ways of achieving it.
• It promotes declarative style of programming for templates
and imperative one for JavaScript code (controllers and
business logic)
Modules
Dependency Injection
• In addition to registering objects in a namespace, it is also
possible to declaratively describe dependencies among those
objects.
• It can perform following activities:
 Understand a need for collaborator expressed by objects.
 Wire up objects together into fully –functional application
Dependency Injection ($scope Obj)
Services
Controller example
var myApp = angular.module('myApp',[]);
myApp.controller('GreetingController', ['$scope',
function($scope) {
$scope.greeting = 'Hola!';
}]);
Registering Services
Angular services are substitutable objects that are wired
together using dependency injection (DI). You can use services to
organize and share code across your app.
Service example
Filters
A filter formats the value of an expression for display to the
user. They can be used in view templates, controllers or
services and it is easy to define your own filter.
Filter example
<div ng-controller="FilterController as ctrl">
<div>
All entries:
<span ng-repeat="entry in ctrl.array">{{entry.name}} </span>
</div>
<div>
Entries that contain an "a":
<span ng-repeat="entry in ctrl.filteredArray">{{entry.name}} </span>
</div>
</div>
angular.module('FilterInControllerModule', []).
controller('FilterController', ['filterFilter', function(filterFilter) {
this.array = [
{name: 'Tobias'},
{name: 'Jeff'},
{name: 'Brian'},
{name: 'Igor'},
{name: 'James'},
{name: 'Brad'}
];
this.filteredArray = filterFilter(this.array, 'a');
}]);
Communicating with Back-end Server
• AngularJS is well equiped with various back-ends using
XMLHttpRequest (XHR) and JSONP requests.
• It has a general purpose $http service for issuing XHR and
JSONP calls as well as a specialized $resource service to easily
target RESTful endpoints.
Making XHP requests with $http
Other XHR request methods
• GET : $http.get(url, config)
• POST : $http.post(url, data, config)
• PUT : $http.put(url, data, config)
• DELETE : $http.delete(url, config)
• HEAD : $http.head
• JSON : $http.jsonp(url, config)
Request/Response data conversion
• The $http.post and $http.put methods accept any JavaScript
object (or a String) value as their data parameter. If data is a
javaScript object it will be by default , converted to a JSON
string.
• The $http service will try to convert responses containg a
JSON string into JavaScript object.
HTTP Response parameters
• Data : The actual response data
• Status : The HTTP status
• Headers : HTTP response headers
• Config : The configurable object that was supplied with
request.
$resource service
• AngularJS provides a dedicated $resource services to make
interactions with REST endpoints.
• The $resource service is distributed in a separate file (angular-
resource.js), and resides in a dedicated module (ngResource).
• To use $resource we need to declare dependency on the
ngResource module from our application.
$resource example
Forms
Controls (input, select, textarea) are ways for a user to enter
data. A Form is a collection of controls for the purpose of
grouping related controls together.
Creating a form
Processing form
Form output
Using CSS classess
• ng-valid: the model is valid
• ng-invalid: the model is invalid
• ng-valid-[key]: for each valid key added by $setValidity
• ng-invalid-[key]: for each invalid key added by $setValidity
• ng-pristine: the control hasn't been interacted with yet
• ng-dirty: the control has been interacted with
• ng-touched: the control has been blurred
• ng-untouched: the control hasn't been blurred
• ng-pending: any $asyncValidators are unfulfilled
Customizing Form UI
<style type="text/css">
.css-form input.ng-invalid.ng-touched {
background-color: #FA787E;
}
.css-form input.ng-valid.ng-touched {
background-color: #78FA89;
}
</style>
Validating an email form field
<div ng-show="form.$submitted || form.uEmail.$touched">
<span ng-show="form.uEmail.$error.required">Tell us your
email.</span>
<span ng-show="form.uEmail.$error.email">This is not a valid
email.</span>
</div>
Why Should We Use AngularJS?
• MVC done right
• A declarative user interface
• Data models are POJO
• Behavior with directives
• Flexibility with filters
• Write less code
• DOM manipulations
• Service providers
• Unit testing ready
• Dynamic binding
Thank You

More Related Content

What's hot

Angular js
Angular jsAngular js
Angular js
Dinusha Nandika
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
Akshay Mathur
 
Angular js
Angular jsAngular js
Angular js
sanjay joshi
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Apaichon Punopas
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
Wei Ru
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
Cornel Stefanache
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
Dan Wahlin
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
Boyan Mihaylov
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
Sagar Acharya
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
Ran Wahle
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
dizabl
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
Imtiyaz Ahmad Khan
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
Anuradha Bandara
 
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 Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodution
adesh21
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
cncwebworld
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
Santosh Kumar Kar
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
Munir Hoque
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Ravi Mone
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
Bipin
 

What's hot (20)

Angular js
Angular jsAngular js
Angular js
 
Getting Started with Angular JS
Getting Started with Angular JSGetting Started with Angular JS
Getting Started with Angular JS
 
Angular js
Angular jsAngular js
Angular js
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
 
Practical AngularJS
Practical AngularJSPractical AngularJS
Practical AngularJS
 
AngularJS Basic Training
AngularJS Basic TrainingAngularJS Basic Training
AngularJS Basic Training
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)Angular js architecture (v1.4.8)
Angular js architecture (v1.4.8)
 
Angular JS Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodution
 
Angular JS tutorial
Angular JS tutorialAngular JS tutorial
Angular JS tutorial
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 

Viewers also liked

NES Global - Life Sciences Brochure 2016
NES Global - Life Sciences Brochure 2016NES Global - Life Sciences Brochure 2016
NES Global - Life Sciences Brochure 2016
Joe Long
 
Osha300 a
Osha300 aOsha300 a
Osha300 a
Isai Serrano
 
Детский консультативный Центр
Детский консультативный ЦентрДетский консультативный Центр
Детский консультативный Центр
damnedney
 
піраміда 1
піраміда 1піраміда 1
піраміда 1
2015aksyonov
 
Информационные технологии в деятельности психолога практика: повышение квалиф...
Информационные технологии в деятельности психолога практика: повышение квалиф...Информационные технологии в деятельности психолога практика: повышение квалиф...
Информационные технологии в деятельности психолога практика: повышение квалиф...
Ilya Perminov
 
S2017 1. ansøgning Magasin dansk
S2017 1. ansøgning Magasin danskS2017 1. ansøgning Magasin dansk
S2017 1. ansøgning Magasin danskHenriette Pilegaard
 
Print prezent anastassia filatova
Print prezent anastassia filatovaPrint prezent anastassia filatova
Print prezent anastassia filatova
Анастасия Филатова
 
El planner
El plannerEl planner
Детский центр на Опарина 4
Детский центр на Опарина 4Детский центр на Опарина 4
Детский центр на Опарина 4
damnedney
 
Evaluation question 7
Evaluation question 7Evaluation question 7
Evaluation question 7
maxdellimayo
 
Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...
Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...
Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...
damnedney
 
Today we explored the sports that children play in Ghana
Today we explored the sports that children play in GhanaToday we explored the sports that children play in Ghana
Today we explored the sports that children play in Ghana
clarmadd
 
Ppt
PptPpt

Viewers also liked (17)

NES Global - Life Sciences Brochure 2016
NES Global - Life Sciences Brochure 2016NES Global - Life Sciences Brochure 2016
NES Global - Life Sciences Brochure 2016
 
ofr-566
ofr-566ofr-566
ofr-566
 
Osha300 a
Osha300 aOsha300 a
Osha300 a
 
Детский консультативный Центр
Детский консультативный ЦентрДетский консультативный Центр
Детский консультативный Центр
 
піраміда 1
піраміда 1піраміда 1
піраміда 1
 
Информационные технологии в деятельности психолога практика: повышение квалиф...
Информационные технологии в деятельности психолога практика: повышение квалиф...Информационные технологии в деятельности психолога практика: повышение квалиф...
Информационные технологии в деятельности психолога практика: повышение квалиф...
 
S2017 1. ansøgning Magasin dansk
S2017 1. ansøgning Magasin danskS2017 1. ansøgning Magasin dansk
S2017 1. ansøgning Magasin dansk
 
Print prezent anastassia filatova
Print prezent anastassia filatovaPrint prezent anastassia filatova
Print prezent anastassia filatova
 
KELEVRAGAMING
KELEVRAGAMINGKELEVRAGAMING
KELEVRAGAMING
 
El planner
El plannerEl planner
El planner
 
Детский центр на Опарина 4
Детский центр на Опарина 4Детский центр на Опарина 4
Детский центр на Опарина 4
 
Evaluation question 7
Evaluation question 7Evaluation question 7
Evaluation question 7
 
Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...
Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...
Роды и ведение беременности в научном Центре акушерства, гинекологии и перина...
 
Jihadismo in Libia_Full Version
Jihadismo in Libia_Full VersionJihadismo in Libia_Full Version
Jihadismo in Libia_Full Version
 
Today we explored the sports that children play in Ghana
Today we explored the sports that children play in GhanaToday we explored the sports that children play in Ghana
Today we explored the sports that children play in Ghana
 
J KHAN CV
J KHAN CVJ KHAN CV
J KHAN CV
 
Ppt
PptPpt
Ppt
 

Similar to Angular js

Angular
AngularAngular
Angular
LearningTech
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
Nitin Giri
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
Gaurav Agrawal
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
Suresh Patidar
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
EPAM Systems
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
jobinThomas54
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
Ran Wahle
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
Gianluca Cacace
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
Filip Janevski
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
Infragistics
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
Vipin Mundayad
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
Mindfire Solutions
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
David Parsons
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
Phan Tuan
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
Stéphane Bégaudeau
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
Keith Bloomfield
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
Eugene Fidelin
 
Angular js 1.3 presentation for fed nov 2014
Angular js 1.3 presentation for fed   nov 2014Angular js 1.3 presentation for fed   nov 2014
Angular js 1.3 presentation for fed nov 2014
Sarah Hudson
 

Similar to Angular js (20)

Angular
AngularAngular
Angular
 
Angular
AngularAngular
Angular
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Learning AngularJS - Complete coverage of AngularJS features and concepts
Learning AngularJS  - Complete coverage of AngularJS features and conceptsLearning AngularJS  - Complete coverage of AngularJS features and concepts
Learning AngularJS - Complete coverage of AngularJS features and concepts
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
AgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllersAgularJS basics- angular directives and controllers
AgularJS basics- angular directives and controllers
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
AngularJS Workshop
AngularJS WorkshopAngularJS Workshop
AngularJS Workshop
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
Introduction to single page application with angular js
Introduction to single page application with angular jsIntroduction to single page application with angular js
Introduction to single page application with angular js
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
AngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get startedAngularJS 101 - Everything you need to know to get started
AngularJS 101 - Everything you need to know to get started
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
Angular js 1.3 presentation for fed nov 2014
Angular js 1.3 presentation for fed   nov 2014Angular js 1.3 presentation for fed   nov 2014
Angular js 1.3 presentation for fed nov 2014
 
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
 

Recently uploaded

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
ayushiqss
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
varshanayak241
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
Georgi Kodinov
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
Tier1 app
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
IES VE
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
Ortus Solutions, Corp
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Why React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdfWhy React Native as a Strategic Advantage for Startup Innovation.pdf
Why React Native as a Strategic Advantage for Startup Innovation.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Strategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptxStrategies for Successful Data Migration Tools.pptx
Strategies for Successful Data Migration Tools.pptx
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Using IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New ZealandUsing IESVE for Room Loads Analysis - Australia & New Zealand
Using IESVE for Room Loads Analysis - Australia & New Zealand
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024BoxLang: Review our Visionary Licenses of 2024
BoxLang: Review our Visionary Licenses of 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 

Angular js

  • 2. What is AngularJS? AngularJS is a client-side MVC framework written in JavaScript. It greatly helps us to write modern, single-page, Ajax-style web applications. Although, it is a general purpose framework, but it truly shines when used with CRUD type applications.
  • 3. Setting up AngularJS environment Including AngularJS library • Download from angularjs.org • Or use one hosted on Google’s CDN network like so <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/ang ular.min.js"> </script>
  • 4. Simple Hello World application
  • 6. One Way Data Binding
  • 7. Two Way Data Binding
  • 9. Scopes • A $scope object in AngularJS is here to expose the domain model to a view. • By assigning properties to scope instances, we can make new values available to a template for rendering.
  • 10. Getter Functions <h1> Hello, {{ getName() }} </h1>
  • 11. Controllers • Controller is a JavaScript constructor function to initialize scope objects. • When a Controller is attached to the DOM via the ng-controller directive, Angular will instantiate a new Controller object, using the specified Controller's constructor function. A new child scope will be available as an injectable parameter to the Controller's constructor function as $scope.
  • 12. Use controllers to : • Set up the initial state of the $scope object. • Add UI specific behavior to the $scope object.
  • 13. Model • AngularJS models are plain, old JavaScript objects. • Any valid Javascript object or array can be passed to a model. • To expose a model to AngularJS you simply assign it to a $scope.
  • 14. Hierarchy in scopes • We need to have at least one instance of a scope to create a new scope because ng-controller directive will create a new scope using Scope.$new() • AngularJS has a $rootScope i.e. a parent of all the scopes. • $rootScope instance gets created when a new application is bootstrap. • Scopes are arranged in hierarchical structure which mimic the DOM tree of the application.
  • 17. Fetching parent scope using $parent
  • 18. Rule of thumb Try to avoid using the $parent property as it strongly links AngularJS expressions to the DOM structure created by your tempaltes. An application might break as a result of simple changes.
  • 20. Declarative template view – imperative controller logic • AngularJS promotes declarative approach to UI construction. Templates are focused on describing a desired effect rather than on ways of achieving it. • It promotes declarative style of programming for templates and imperative one for JavaScript code (controllers and business logic)
  • 22. Dependency Injection • In addition to registering objects in a namespace, it is also possible to declaratively describe dependencies among those objects. • It can perform following activities:  Understand a need for collaborator expressed by objects.  Wire up objects together into fully –functional application
  • 25. Controller example var myApp = angular.module('myApp',[]); myApp.controller('GreetingController', ['$scope', function($scope) { $scope.greeting = 'Hola!'; }]);
  • 26. Registering Services Angular services are substitutable objects that are wired together using dependency injection (DI). You can use services to organize and share code across your app.
  • 28. Filters A filter formats the value of an expression for display to the user. They can be used in view templates, controllers or services and it is easy to define your own filter.
  • 29. Filter example <div ng-controller="FilterController as ctrl"> <div> All entries: <span ng-repeat="entry in ctrl.array">{{entry.name}} </span> </div> <div> Entries that contain an "a": <span ng-repeat="entry in ctrl.filteredArray">{{entry.name}} </span> </div> </div>
  • 30. angular.module('FilterInControllerModule', []). controller('FilterController', ['filterFilter', function(filterFilter) { this.array = [ {name: 'Tobias'}, {name: 'Jeff'}, {name: 'Brian'}, {name: 'Igor'}, {name: 'James'}, {name: 'Brad'} ]; this.filteredArray = filterFilter(this.array, 'a'); }]);
  • 31. Communicating with Back-end Server • AngularJS is well equiped with various back-ends using XMLHttpRequest (XHR) and JSONP requests. • It has a general purpose $http service for issuing XHR and JSONP calls as well as a specialized $resource service to easily target RESTful endpoints.
  • 32. Making XHP requests with $http
  • 33. Other XHR request methods • GET : $http.get(url, config) • POST : $http.post(url, data, config) • PUT : $http.put(url, data, config) • DELETE : $http.delete(url, config) • HEAD : $http.head • JSON : $http.jsonp(url, config)
  • 34. Request/Response data conversion • The $http.post and $http.put methods accept any JavaScript object (or a String) value as their data parameter. If data is a javaScript object it will be by default , converted to a JSON string. • The $http service will try to convert responses containg a JSON string into JavaScript object.
  • 35. HTTP Response parameters • Data : The actual response data • Status : The HTTP status • Headers : HTTP response headers • Config : The configurable object that was supplied with request.
  • 36. $resource service • AngularJS provides a dedicated $resource services to make interactions with REST endpoints. • The $resource service is distributed in a separate file (angular- resource.js), and resides in a dedicated module (ngResource). • To use $resource we need to declare dependency on the ngResource module from our application.
  • 38. Forms Controls (input, select, textarea) are ways for a user to enter data. A Form is a collection of controls for the purpose of grouping related controls together.
  • 42. Using CSS classess • ng-valid: the model is valid • ng-invalid: the model is invalid • ng-valid-[key]: for each valid key added by $setValidity • ng-invalid-[key]: for each invalid key added by $setValidity • ng-pristine: the control hasn't been interacted with yet • ng-dirty: the control has been interacted with • ng-touched: the control has been blurred • ng-untouched: the control hasn't been blurred • ng-pending: any $asyncValidators are unfulfilled
  • 43. Customizing Form UI <style type="text/css"> .css-form input.ng-invalid.ng-touched { background-color: #FA787E; } .css-form input.ng-valid.ng-touched { background-color: #78FA89; } </style>
  • 44. Validating an email form field <div ng-show="form.$submitted || form.uEmail.$touched"> <span ng-show="form.uEmail.$error.required">Tell us your email.</span> <span ng-show="form.uEmail.$error.email">This is not a valid email.</span> </div>
  • 45. Why Should We Use AngularJS? • MVC done right • A declarative user interface • Data models are POJO • Behavior with directives • Flexibility with filters • Write less code • DOM manipulations • Service providers • Unit testing ready • Dynamic binding