SlideShare una empresa de Scribd logo
1 de 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

Más contenido relacionado

La actualidad más candente

Angular js presentation at Datacom
Angular js presentation at DatacomAngular js presentation at Datacom
Angular js presentation at Datacom
David Xi Peng Yang
 

La actualidad más candente (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
 

Destacado

Destacado (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
 

Similar a Angularjs basic part01

Similar a 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
 

Último

Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
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
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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)
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
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Ữ Â...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

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

Notas del editor

  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