SlideShare uma empresa Scribd logo
1 de 35
Anuradha Bandara
How Web Page Creates?
 HTML (Structure)
 Css (Style)
 Javascript (Behavior)
◦ HTML tags create objects.
 In other words……Document Object Model(DOM)
◦ <SCRIPT></SCRIPT>
 Once page found this tag – Start download the javascript.
◦ JavaScript lets you manipulate the DOM.
◦ Css – do the styles.
What is DOM?
 The Document Object Model (DOM) is an application programming
interface (API) for valid HTML and well-formed XML documents. It
defines the logical structure of documents and the way a document
is accessed and manipulated.
DOM Structure
DOM Structure
What is Angularjs?
 A JavaScript framework for creating
dynamic web applications
 Open Source
◦ GitHub:
https://github.com/angular/angular.js
◦ MIT License
 Uses jQuery
◦ jQuery 1.7.1 or above
◦ jQLite
MVC or MVW….
 Model
◦ The data
 View
◦ The interface
◦ How the data is presented to the user
 Whatever
(Controller/Services/Directives/Filters)
◦ The behavior
◦ Modifying / updating the models
How Angularjs works?
 bindJQuery() : Either one of jQuery or jqLite is bound to angular.
 angularInit(document, bootstrap) : method which checks for ng-app module
 bootstrap(element) : method which is invoked once an ng-app module is found
◦ Invoke createInjector() method which returns dependency injector
◦ The dependency injector invokes the compilation and linking process with some of the following
key parameters:
 Scope object – Reference to rootScope
 Reference to element with ng-app
 Compile service
 Reference to dependency injector
How Angularjs works? Cont…
 compile(element): bind events to the element
 compile(element)(scope): bind element to the scope
◦ At this phase compiler will look for every directive and creates the watchers ($watch) that are
needed.
 scope.$apply(function{}): Finally, the $apply method is invoked on
the scope object
As a result of execution of $apply
method, the view appears……
How Angularjs works? Cont…
Reusable components with
directives….
 A directive is an extension of the HTML vocabulary that allows us to
create new behaviours. This technology lets the developers create
reusable components that can be used within the whole application.
 The directive can be applied as an
◦ Attribute
◦ Element
◦ Class
◦ Comment
 we can use ng-model, ng:model, ng_model,data-ng-model,
and x-ng-model in the HTML markup.
AngularJS built-in directives...
 ngApp - defines the root of an AngularJS application
 ngController - attach any controller to the view
◦ Nested Controllers
 ngBind – act as same as {{expression}}
 ngBindHtml – bind plain html
AngularJS built-in directives...
 ngRepeat - iterate over arrays and objects.
 ngModel - attaches the element to a property in
the scope
 ngClick – bind any custom behavior to the click
event of the element
 ngDisable – disable elements based on the
Boolean value of an expression.
 ngClass – dynamically apply a class to an element
 ngOptions – create the options of a select element
 ngStyle – apply the dynamic style configuration
demand
AngularJS built-in directives...
 ngShow/ngHide – apply visibility of an element
based on its
display property.
 ngIf - prevents the rendering of an element in our template
 ngClick – bind any custom behavior to the click
event of the element
 ngInclude – include other external HTML fragments in to
pages
Create own Directory
Directive properties
Dependency Injection
and Services…
 Services
◦ Use to isolating the business logic in the application
 Lazily instantiated – Angular only instantiates a service when an application component depends on it.
 Singletons – Each component dependent on a service gets a reference to the single instance generated
by the service factory.
 No UI
 Dependency Injection
◦ A software design pattern that deals with how components get hold of
their dependencies.
◦ eg :
Dependency Injection
and Services…
 Custom Services
◦ We can define our own custom services in different ways in angular js app
and use them wherever required
 Service()
 Factory()
 Provider()
Dependency Injection
and Services…
 Creating services with the factory
◦ You give angular a function
◦ Angular create an object
◦ add properties to it
◦ return that same object
Dependency Injection
and Services…
 Creating services with the Service
◦ You give angular a function
◦ Angular will instantiated with the ‘new’ keyword
◦ add properties to “this”
◦ return “this”
Dependency Injection
and Services…
 Creating services with the Provider
◦ You give angular a function
◦ angular will call its $get function
◦ return value from the $get function
Data handling…
 Expressions
 Filters
 Form validations
Data handling…
 Expressions
◦ An expression is a simple piece of code
that will be evaluated by the framework
and can be written between double curly
brackets
eg : {{car.plate}}
Data handling…
 Filters
◦ perfect solution to easily perform any data manipulation.
 Eg :
 {{expression | filter}}
 {{expression | filter1 | filter2}}
◦ Currency
 {{ 10 | currency}} => $10.00 (take locale currency)
 {{ 10 | currency:'R$'}} => R$ 10.00
◦ Date
 {{ car.entrance | date }} => Dec 10, 2014
 {{ car.entrance | date:'MMMM dd/MM/yyyy HH:mm:ss' }} =>
December 10/12/2013 21:42:10.
Data handling…
 Filters
◦ Filter
◦ Json
 {{ car | json }} =>
Data handling…
 Filters
◦ limitTo – limit size to 10
 {{ expression | limitTo:10 }}
◦ Lowercase – convert to lowercase
 {{ expression | lowercase }}
◦ Number – limit two decimal places
 {{ 10 | number:2 }} => 10.00
◦ Orderby – orderby String/Array
 {{ expression | orderBy:predicate:reverse }}
Data handling…
 Creating custom filters
Data handling…
 Form validations
 $pristine =>form is not modified
 $dirty => form is modified
Data handling…
 Form validations
 $error => It accumulates the detailed list of
everything that happens with the form
Data Binding – Two way
 Data-binding in Angular apps is the automatic synchronization of
data between the model and view components.
 The view is a projection of the model at all times. When the model
changes, the view reflects the change, and vice versa.
How Data binding works?
Exactly what happen when you do event on a
browser….
 browser is waiting for events / user interactions.
 click on a button or write into an input.
 fire browser event loop.
 browser will make the appropriate changes in the DOM
How Data binding works?
How angulerjs reacts?
 When you create ui component using directive
 Add $watch to watch list call $digest
 After fire event loop $digest loop will be fired.
 It checks values are updated.
 Call $apply()
As a result of execution of $apply method, the view
updated……
Scope….
 scope is an object that refers to the application model
 Scopes are arranged in hierarchical structure which mimic the DOM
structure of the application
 Create connection between view & controller
$rootscope / $parent / $scope
You give angular a functionYou give angular a function
Exercise..
 Writing own directory…
◦ Replace label with dropdown when click
the edit button.
◦ When user change the dropdown
automatically update the model.
Thank you….

Mais conteúdo relacionado

Mais procurados

AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish MinutesDan Wahlin
 
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 JSSimon Guest
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS introdizabl
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developersKai Koenig
 
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 OrientDBApaichon Punopas
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeMark Meyer
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IVisual Engineering
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architectureGabriele Falace
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
Angularjs Anti-patterns
Angularjs Anti-patternsAngularjs Anti-patterns
Angularjs Anti-patternsSteven Lambert
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXAngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXJWORKS powered by Ordina
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework Sakthi Bro
 

Mais procurados (20)

Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
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
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS intro
AngularJS introAngularJS intro
AngularJS intro
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 
AngularJS for designers and developers
AngularJS for designers and developersAngularJS for designers and developers
AngularJS for designers and developers
 
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
 
Angularjs
AngularjsAngularjs
Angularjs
 
Top 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers MakeTop 10 Mistakes AngularJS Developers Make
Top 10 Mistakes AngularJS Developers Make
 
Workshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte IWorkshop 12: AngularJS Parte I
Workshop 12: AngularJS Parte I
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
Angularjs Anti-patterns
Angularjs Anti-patternsAngularjs Anti-patterns
Angularjs Anti-patterns
 
AngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UXAngularJS Basics and Best Practices - CC FE &UX
AngularJS Basics and Best Practices - CC FE &UX
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 

Semelhante a How Web Pages Are Created With HTML, CSS & JavaScript

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarAppfinz Technologies
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014Ran Wahle
 
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 jsMindfire Solutions
 
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 conceptsSuresh Patidar
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs WorkshopRan Wahle
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseEPAM Systems
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development GuideNitin Giri
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basicsRavindra K
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopDrew Morris
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAnass90
 

Semelhante a How Web Pages Are Created With HTML, CSS & JavaScript (20)

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
Angular js
Angular jsAngular js
Angular js
 
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
 
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
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
Angular js slides
Angular js slidesAngular js slides
Angular js slides
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
Angular Js Get Started - Complete Course
Angular Js Get Started - Complete CourseAngular Js Get Started - Complete Course
Angular Js Get Started - Complete Course
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
GDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and WorkshopGDG Atlanta - Angular.js Demo and Workshop
GDG Atlanta - Angular.js Demo and Workshop
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angular js workshop
Angular js workshopAngular js workshop
Angular js workshop
 
AngularJS By Vipin
AngularJS By VipinAngularJS By Vipin
AngularJS By Vipin
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Angular js
Angular jsAngular js
Angular js
 

Último

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Último (20)

INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

How Web Pages Are Created With HTML, CSS & JavaScript

  • 2. How Web Page Creates?  HTML (Structure)  Css (Style)  Javascript (Behavior) ◦ HTML tags create objects.  In other words……Document Object Model(DOM) ◦ <SCRIPT></SCRIPT>  Once page found this tag – Start download the javascript. ◦ JavaScript lets you manipulate the DOM. ◦ Css – do the styles.
  • 3. What is DOM?  The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated.
  • 6. What is Angularjs?  A JavaScript framework for creating dynamic web applications  Open Source ◦ GitHub: https://github.com/angular/angular.js ◦ MIT License  Uses jQuery ◦ jQuery 1.7.1 or above ◦ jQLite
  • 7. MVC or MVW….  Model ◦ The data  View ◦ The interface ◦ How the data is presented to the user  Whatever (Controller/Services/Directives/Filters) ◦ The behavior ◦ Modifying / updating the models
  • 8. How Angularjs works?  bindJQuery() : Either one of jQuery or jqLite is bound to angular.  angularInit(document, bootstrap) : method which checks for ng-app module  bootstrap(element) : method which is invoked once an ng-app module is found ◦ Invoke createInjector() method which returns dependency injector ◦ The dependency injector invokes the compilation and linking process with some of the following key parameters:  Scope object – Reference to rootScope  Reference to element with ng-app  Compile service  Reference to dependency injector
  • 9. How Angularjs works? Cont…  compile(element): bind events to the element  compile(element)(scope): bind element to the scope ◦ At this phase compiler will look for every directive and creates the watchers ($watch) that are needed.  scope.$apply(function{}): Finally, the $apply method is invoked on the scope object As a result of execution of $apply method, the view appears……
  • 11. Reusable components with directives….  A directive is an extension of the HTML vocabulary that allows us to create new behaviours. This technology lets the developers create reusable components that can be used within the whole application.  The directive can be applied as an ◦ Attribute ◦ Element ◦ Class ◦ Comment  we can use ng-model, ng:model, ng_model,data-ng-model, and x-ng-model in the HTML markup.
  • 12. AngularJS built-in directives...  ngApp - defines the root of an AngularJS application  ngController - attach any controller to the view ◦ Nested Controllers  ngBind – act as same as {{expression}}  ngBindHtml – bind plain html
  • 13. AngularJS built-in directives...  ngRepeat - iterate over arrays and objects.  ngModel - attaches the element to a property in the scope  ngClick – bind any custom behavior to the click event of the element  ngDisable – disable elements based on the Boolean value of an expression.  ngClass – dynamically apply a class to an element  ngOptions – create the options of a select element  ngStyle – apply the dynamic style configuration demand
  • 14. AngularJS built-in directives...  ngShow/ngHide – apply visibility of an element based on its display property.  ngIf - prevents the rendering of an element in our template  ngClick – bind any custom behavior to the click event of the element  ngInclude – include other external HTML fragments in to pages
  • 16. Dependency Injection and Services…  Services ◦ Use to isolating the business logic in the application  Lazily instantiated – Angular only instantiates a service when an application component depends on it.  Singletons – Each component dependent on a service gets a reference to the single instance generated by the service factory.  No UI  Dependency Injection ◦ A software design pattern that deals with how components get hold of their dependencies. ◦ eg :
  • 17. Dependency Injection and Services…  Custom Services ◦ We can define our own custom services in different ways in angular js app and use them wherever required  Service()  Factory()  Provider()
  • 18. Dependency Injection and Services…  Creating services with the factory ◦ You give angular a function ◦ Angular create an object ◦ add properties to it ◦ return that same object
  • 19. Dependency Injection and Services…  Creating services with the Service ◦ You give angular a function ◦ Angular will instantiated with the ‘new’ keyword ◦ add properties to “this” ◦ return “this”
  • 20. Dependency Injection and Services…  Creating services with the Provider ◦ You give angular a function ◦ angular will call its $get function ◦ return value from the $get function
  • 21. Data handling…  Expressions  Filters  Form validations
  • 22. Data handling…  Expressions ◦ An expression is a simple piece of code that will be evaluated by the framework and can be written between double curly brackets eg : {{car.plate}}
  • 23. Data handling…  Filters ◦ perfect solution to easily perform any data manipulation.  Eg :  {{expression | filter}}  {{expression | filter1 | filter2}} ◦ Currency  {{ 10 | currency}} => $10.00 (take locale currency)  {{ 10 | currency:'R$'}} => R$ 10.00 ◦ Date  {{ car.entrance | date }} => Dec 10, 2014  {{ car.entrance | date:'MMMM dd/MM/yyyy HH:mm:ss' }} => December 10/12/2013 21:42:10.
  • 24. Data handling…  Filters ◦ Filter ◦ Json  {{ car | json }} =>
  • 25. Data handling…  Filters ◦ limitTo – limit size to 10  {{ expression | limitTo:10 }} ◦ Lowercase – convert to lowercase  {{ expression | lowercase }} ◦ Number – limit two decimal places  {{ 10 | number:2 }} => 10.00 ◦ Orderby – orderby String/Array  {{ expression | orderBy:predicate:reverse }}
  • 27. Data handling…  Form validations  $pristine =>form is not modified  $dirty => form is modified
  • 28. Data handling…  Form validations  $error => It accumulates the detailed list of everything that happens with the form
  • 29. Data Binding – Two way  Data-binding in Angular apps is the automatic synchronization of data between the model and view components.  The view is a projection of the model at all times. When the model changes, the view reflects the change, and vice versa.
  • 30. How Data binding works? Exactly what happen when you do event on a browser….  browser is waiting for events / user interactions.  click on a button or write into an input.  fire browser event loop.  browser will make the appropriate changes in the DOM
  • 31. How Data binding works? How angulerjs reacts?  When you create ui component using directive  Add $watch to watch list call $digest  After fire event loop $digest loop will be fired.  It checks values are updated.  Call $apply() As a result of execution of $apply method, the view updated……
  • 32. Scope….  scope is an object that refers to the application model  Scopes are arranged in hierarchical structure which mimic the DOM structure of the application  Create connection between view & controller
  • 33. $rootscope / $parent / $scope You give angular a functionYou give angular a function
  • 34. Exercise..  Writing own directory… ◦ Replace label with dropdown when click the edit button. ◦ When user change the dropdown automatically update the model.

Notas do Editor

  1. Use multiple points, if necessary.
  2. Use brief bullets and discuss details verbally.