SlideShare ist ein Scribd-Unternehmen logo
1 von 29
http://angularjs.org
(AngularJS Basic)
AngularJS:
•Is a client-side MVC JavaScript framework for writing single page
web applications(SPA).
•It's built and mantained by Google.
•Help us building testable web applications that scale.
•It lets you use HTML as your template language and lets you
extend HTML's syntax to express your application's components
clearly and succinctly.
•The unique and innovative features are two-way-data bindings,
dependency injection, easy-to-test code and extending the HTML
dialect by using directives.
Single Page Applications (SPA)
•In a Single Page Application (SPA), either all necessary code (HTML,
CSS, JavaScript) is retrieved with a single page load.
•Appropiate resources are dynamically loaded and added to the page
as necessary, ussually in response to user actions.
•The page does not reload at any point in the process.
•Interaction with the single page application often involves dynamic
communication with the web server behind the scenes.
•SPAs are backe-end independent, and we only care about the JSON
data coming back, be it from JAVA, .NET, PHP or any other server-side
language.
Some key features of the Angular JS in web
development:
•Two way data binding
•MVC framework
•Templating
•Custom-directive (reusable components)
•REST-friendly
•Set up a link for any dynamic page
•Form Validation
•Server Comunication
•Localization
•Dependency injection
•Full testing environment
•AngularJS can do everything that jQuery does and much more,
yet is roughly equivalent in download size
AngularJS vs jQuery
jQuery AngularJS
Restful API NO YES
Integration test runner NO YES
MVC support NO YES
Template NO YES
Two way data binding NO YES
Dependency injection NO YES
AJAX YES YES
Cross Module Communication YES YES
Unit test runner YES YES
Form validation NO YES
Localization NO YES
File size 86.7 kb 167.1 kb
Main components of AngularJS:
•Directives - AngularJS directives are extended HTML attributes
with the prefix ng-
•Modules - Where our application components live
•Controllers - Where we add application behavior & logics of our
application.
•Expressions - How values get displayed within the page
Modules
•We can think of a module as a container for the different parts
of your app – controllers, services, filters, directives, etc.
•A container for different parts of application
•Modules can have other modules as dependencies
Getting started
Creating a module
Controllers
•An Angular Controller allows us to interact with a View and
Model, it's the place where presentational logic can take place to
keep the UI bindings in sync with the Model.
Dependency injection
When MyController is created by AngularJS, the $scope and instances
of dep1 and dep2 are automatically passed in. This eliminates the need
for hard-coding dependencies with global variables or creating instances
manually within the component, which greatly complicates and limits
testability.
Expressions
•Allow you to insert dynamic values into your HTML.
•AngularJS expressions are written inside double braces: {{expression}}
•Binds data to HTML the same way as the ng-bind directive, and output
the data exactly were the directive is written.
•They are used for small calculations only or getting the value of $scope
properties.
$scope
•Every controller has an associated $scope object.
•$scope is an object that refers to the application model
•In the Model-View-Controller structure, the $scope object
becomes the model.
•We only use $scope inside Controllers, where we bind data
from the Controller to the View.
Views
Directives
AngularJS extends HTML through use of directives, a feature that
allows you to create your own HTML elements.
- ng-app directive initializes an AngularJS application.
- ng-init directive initializes application data.
- ng-click directive allows you to specify custom behavior when an
element is clicked
Using directives
_
Custom Directives
Using 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.
Two-way Data Binding
•Data-binding is an automatic way of updating the view
whenever the model changes, as well as updating the model
whenever the view changes.
AngularJS form validation
•There are many form validation directives available in AngularJS:
Creating templates
$http Service
The $http service is a core Angular service that facilitates
communication with the remote HTTP servers via the browser's
XMLHttpRequest object or via JSONP.
Custom services
•We can define our own custom services in AngularJS apps and
use them wherever required.
•There are several ways to declare AngularJS service within
application. Following are two simple ways:
The Role of Factories
AngularJS routing
•Since we are making a single page application and we don’t
want any page refreshes, we’ll use Angular’s routing capabilities.
Defining routes
Pain Points
•Angular Expressions are used extensively in the View layer of
Angular.
•It lets the developer use complicated logic and even perform
assignment operations and calculations, all inside the view
templates
•Putting logic inside the templates makes it harder to test,
sometimes impossible to test.
Summary
•AngularJS provides a robust “SPA” framework for bulding robust client-
side applications.
Key features:
•Directives and filters
•Two-way data binding
•Views, Controllers, Scope
•Modules and Routes
Resources
•http://angularjs.org
•http://builtwith.angularjs.org
•http://angular-ui.github.io
•http://mgcrea.github.io/angular-strap
•http://pluralsight.com

Weitere ähnliche Inhalte

Was ist angesagt?

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
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSArmin Vieweg
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework Camilo Lopes
 
Introduction to SPA with AngularJS
Introduction to SPA with AngularJSIntroduction to SPA with AngularJS
Introduction to SPA with AngularJSRiki Pribadi
 
ANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEcncwebworld
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSAldo Pizzagalli
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project Elad Hirsch
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0Nagaraju Sangam
 
Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at DatacomDavid Xi Peng Yang
 
Angular JS Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodutionadesh21
 
Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSDeepu S Nath
 

Was ist angesagt? (20)

Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
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
 
Gettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJSGettings started with the superheroic JavaScript library AngularJS
Gettings started with the superheroic JavaScript library AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
Overview about AngularJS Framework
Overview about AngularJS Framework Overview about AngularJS Framework
Overview about AngularJS Framework
 
Introduction to SPA with AngularJS
Introduction to SPA with AngularJSIntroduction to SPA with AngularJS
Introduction to SPA with AngularJS
 
ANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNEANGULAR JS TRAINING IN PUNE
ANGULAR JS TRAINING IN PUNE
 
AngularJS
AngularJSAngularJS
AngularJS
 
AngularJS
AngularJSAngularJS
AngularJS
 
Spa with angular
Spa with angularSpa with angular
Spa with angular
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Angularjs
AngularjsAngularjs
Angularjs
 
AngularJS - Architecture decisions in a large project 
AngularJS - Architecture decisionsin a large project AngularJS - Architecture decisionsin a large project 
AngularJS - Architecture decisions in a large project 
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Introduction to Angular js 2.0
Introduction to Angular js 2.0Introduction to Angular js 2.0
Introduction to Angular js 2.0
 
Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
 
Angular JS Indtrodution
Angular JS IndtrodutionAngular JS Indtrodution
Angular JS Indtrodution
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Coffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JSCoffee@DBG - Exploring Angular JS
Coffee@DBG - Exploring Angular JS
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 

Andere mochten auch

A Very Public and Overdue Funeral for jQuery
A Very Public and Overdue Funeral for jQueryA Very Public and Overdue Funeral for jQuery
A Very Public and Overdue Funeral for jQueryFITC
 
Pemrograman Web 6 - jQuery
Pemrograman Web 6 - jQueryPemrograman Web 6 - jQuery
Pemrograman Web 6 - jQueryNur Fadli Utomo
 
AngularJS vs jQuery
AngularJS vs jQueryAngularJS vs jQuery
AngularJS vs jQueryPayPal
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Arunangsu Sahu
 
Just Do it with jQuery
Just Do it with jQueryJust Do it with jQuery
Just Do it with jQueryselfteachme
 

Andere mochten auch (7)

A Very Public and Overdue Funeral for jQuery
A Very Public and Overdue Funeral for jQueryA Very Public and Overdue Funeral for jQuery
A Very Public and Overdue Funeral for jQuery
 
Pemrograman Web 6 - jQuery
Pemrograman Web 6 - jQueryPemrograman Web 6 - jQuery
Pemrograman Web 6 - jQuery
 
AngularJS vs jQuery
AngularJS vs jQueryAngularJS vs jQuery
AngularJS vs jQuery
 
Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01Angularjs 131211063348-phpapp01
Angularjs 131211063348-phpapp01
 
Jquery
JqueryJquery
Jquery
 
Intro to AngularJS
Intro to AngularJS Intro to AngularJS
Intro to AngularJS
 
Just Do it with jQuery
Just Do it with jQueryJust Do it with jQuery
Just Do it with jQuery
 

Ähnlich wie Angularjs basic part01

AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) PresentationRaghubir Singh
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to AngularjsGaurav Agrawal
 
Angular patterns
Angular patternsAngular patterns
Angular patternsPremkumar M
 
Angularjs overview
Angularjs  overviewAngularjs  overview
Angularjs overviewVickyCmd
 
The A1 by Christian John Felix
The A1 by Christian John FelixThe A1 by Christian John Felix
The A1 by Christian John FelixDEVCON
 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?Albiorix Technology
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaphp2ranjan
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSShyjal Raazi
 
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...Edureka!
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxsarah david
 
A perfect choice for web apps
A perfect choice for web apps A perfect choice for web apps
A perfect choice for web apps adhyathakkar10
 
Angular js up & running
Angular js up & runningAngular js up & running
Angular js up & runningJunaid Baloch
 
Angular JS training institute in Jaipur
           Angular JS training institute in Jaipur           Angular JS training institute in Jaipur
Angular JS training institute in JaipurHEMANT SAXENA
 

Ähnlich wie Angularjs basic part01 (20)

AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
Angular js 1.3 basic tutorial
Angular js 1.3 basic tutorialAngular js 1.3 basic tutorial
Angular js 1.3 basic tutorial
 
Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Angular patterns
Angular patternsAngular patterns
Angular patterns
 
Ajs ppt
Ajs pptAjs ppt
Ajs ppt
 
Angularjs overview
Angularjs  overviewAngularjs  overview
Angularjs overview
 
Itroducing Angular JS
Itroducing Angular JSItroducing Angular JS
Itroducing Angular JS
 
Anjular js
Anjular jsAnjular js
Anjular js
 
The A1 "AngularJS 1 Kick Start"
The A1 "AngularJS 1 Kick Start"The A1 "AngularJS 1 Kick Start"
The A1 "AngularJS 1 Kick Start"
 
The A1 by Christian John Felix
The A1 by Christian John FelixThe A1 by Christian John Felix
The A1 by Christian John Felix
 
What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?What are the key distinctions between Angular and AngularJS?
What are the key distinctions between Angular and AngularJS?
 
Angular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad indiaAngular 6 Training with project in hyderabad india
Angular 6 Training with project in hyderabad india
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
What Is Angular 2 | Angular 2 Tutorial For Beginners | Angular Training | Edu...
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptxangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pptx
 
A perfect choice for web apps
A perfect choice for web apps A perfect choice for web apps
A perfect choice for web apps
 
Angular js up & running
Angular js up & runningAngular js up & running
Angular js up & running
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
Angular JS training institute in Jaipur
           Angular JS training institute in Jaipur           Angular JS training institute in Jaipur
Angular JS training institute in Jaipur
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 

Kürzlich hochgeladen

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 

Kürzlich hochgeladen (20)

80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 

Angularjs basic part01

  • 2. AngularJS: •Is a client-side MVC JavaScript framework for writing single page web applications(SPA). •It's built and mantained by Google. •Help us building testable web applications that scale. •It lets you use HTML as your template language and lets you extend HTML's syntax to express your application's components clearly and succinctly. •The unique and innovative features are two-way-data bindings, dependency injection, easy-to-test code and extending the HTML dialect by using directives.
  • 3. Single Page Applications (SPA) •In a Single Page Application (SPA), either all necessary code (HTML, CSS, JavaScript) is retrieved with a single page load. •Appropiate resources are dynamically loaded and added to the page as necessary, ussually in response to user actions. •The page does not reload at any point in the process. •Interaction with the single page application often involves dynamic communication with the web server behind the scenes. •SPAs are backe-end independent, and we only care about the JSON data coming back, be it from JAVA, .NET, PHP or any other server-side language.
  • 4. Some key features of the Angular JS in web development: •Two way data binding •MVC framework •Templating •Custom-directive (reusable components) •REST-friendly •Set up a link for any dynamic page •Form Validation •Server Comunication •Localization •Dependency injection •Full testing environment •AngularJS can do everything that jQuery does and much more, yet is roughly equivalent in download size
  • 5. AngularJS vs jQuery jQuery AngularJS Restful API NO YES Integration test runner NO YES MVC support NO YES Template NO YES Two way data binding NO YES Dependency injection NO YES AJAX YES YES Cross Module Communication YES YES Unit test runner YES YES Form validation NO YES Localization NO YES File size 86.7 kb 167.1 kb
  • 6. Main components of AngularJS: •Directives - AngularJS directives are extended HTML attributes with the prefix ng- •Modules - Where our application components live •Controllers - Where we add application behavior & logics of our application. •Expressions - How values get displayed within the page
  • 7. Modules •We can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc. •A container for different parts of application •Modules can have other modules as dependencies
  • 10. Controllers •An Angular Controller allows us to interact with a View and Model, it's the place where presentational logic can take place to keep the UI bindings in sync with the Model.
  • 11. Dependency injection When MyController is created by AngularJS, the $scope and instances of dep1 and dep2 are automatically passed in. This eliminates the need for hard-coding dependencies with global variables or creating instances manually within the component, which greatly complicates and limits testability.
  • 12. Expressions •Allow you to insert dynamic values into your HTML. •AngularJS expressions are written inside double braces: {{expression}} •Binds data to HTML the same way as the ng-bind directive, and output the data exactly were the directive is written. •They are used for small calculations only or getting the value of $scope properties.
  • 13. $scope •Every controller has an associated $scope object. •$scope is an object that refers to the application model •In the Model-View-Controller structure, the $scope object becomes the model. •We only use $scope inside Controllers, where we bind data from the Controller to the View.
  • 14. Views
  • 15. Directives AngularJS extends HTML through use of directives, a feature that allows you to create your own HTML elements. - ng-app directive initializes an AngularJS application. - ng-init directive initializes application data. - ng-click directive allows you to specify custom behavior when an element is clicked
  • 18. Using 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.
  • 19. Two-way Data Binding •Data-binding is an automatic way of updating the view whenever the model changes, as well as updating the model whenever the view changes.
  • 20. AngularJS form validation •There are many form validation directives available in AngularJS:
  • 22. $http Service The $http service is a core Angular service that facilitates communication with the remote HTTP servers via the browser's XMLHttpRequest object or via JSONP.
  • 23. Custom services •We can define our own custom services in AngularJS apps and use them wherever required. •There are several ways to declare AngularJS service within application. Following are two simple ways:
  • 24. The Role of Factories
  • 25. AngularJS routing •Since we are making a single page application and we don’t want any page refreshes, we’ll use Angular’s routing capabilities.
  • 27. Pain Points •Angular Expressions are used extensively in the View layer of Angular. •It lets the developer use complicated logic and even perform assignment operations and calculations, all inside the view templates •Putting logic inside the templates makes it harder to test, sometimes impossible to test.
  • 28. Summary •AngularJS provides a robust “SPA” framework for bulding robust client- side applications. Key features: •Directives and filters •Two-way data binding •Views, Controllers, Scope •Modules and Routes

Hinweis der Redaktion

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30