SlideShare a Scribd company logo
1 of 23
Download to read offline
Everything You Need To Know About
By Sina Mirhejazi
WHAT IS ?
➤ It’s not a JavaScript Library. There is no
function which we can directly call and use.
➤ It’s not a DOM manipulation library like
jQuery. But it uses subset of jQuery to
manipulation (Called jqLite).
➤ Focus more on HTML side of web apps.
➤ For MVC/MVVM design patterns.
PHILOSOPHY
➤ Angular is what HTML could have been if it
had been designed for applications.
➤ HTML is a great declarative language for static
documents. It does not contain much in the way
of creating application.
➤ Building web-applications is an exercise in
what do I have to do, so that I trick the browser
in to do what I want.
➤ Thats why we have frameworks - set of utility
functions and libraries for DOM manipulation.
➤ Angular takes another approach.
➤ Angular teaches the browser new syntax.
➤ One way data binding means creating View once and leave Model
behind. Whenever we want to change something, we have to
change Model and render View again.
➤ Two way data binding link View and Model together and every
changes to each one affect another continuously.
➤ How?
WHERE THINGS START?
➤ It all starts when you add angular script to your code. THAT SIMPLE!
ANGULAR MODULES
➤ Angular works with modules.
➤ Module for main App.
➤ Module for components.
➤ Muddle for everything.
ANGULAR CONTROLLERS
➤ We use a Controller to provide data for our Views.
➤ We should not use Controllers to manipulate DOM.
DEPENDENCY INJECTION
➤ DI is a way to tell angular which service needs what.
➤ There are several ways to do this.
SCOPE
➤ Scope is a link between controller and view.
➤ We can add properties to our $scope object in controllers and get them on view.
➤ More on Scopes later.
ANGULAR DIRECTIVES
➤ Directives are out only chance to manipulate DOM.
➤ Directives can teach HTML new stuff.
➤ They can be attributes, classes(!), comments(!) and even tag elements!!!
➤ We seen a couple of them earlier like:
➤ ng-app
➤ ng-controller
➤ ng-repeat
➤ ng-show
ANGULAR DIRECTIVES
➤ ng-app
➤ ng-app specify out main module to run the application.
➤ IT goes on <html> tag.
➤ ng-controller
➤ ng-controller link a controller to part of our DOM.
➤ $scope of controller affect the part of DOM that ng-controller linked to. And It’s
child of course.
ANGULAR DIRECTIVES
➤ ng-repeat
➤ ng-repeat iterate between items of a given object/array. Just like for…in.
➤ ng-show/ng-hide
➤ These twins get an expression and show/hide whether it’s true or false.
➤ ng-if
➤ This one gets an expression and comment/uncomment the element that contains
it.
ANGULAR DIRECTIVES
➤ ng-click
➤ ng-click get an expression(usually a function) and fire that expression in case of
click.
➤ ng-bind
➤ This one is all awesomeness of AngularJS
➤ ng-bind replace text content of it’s tag with a given expression.
➤ AND change it whenever expression change!
➤ It has a little brother named {{expression}}
ANGULAR EXPRESSIONS
➤ What is this expression we keep talking about?
➤ Expression is a snippet of JavaScript code, inside HTML tags and attributes.
➤ They live inside HTML tags under the shield of {{}} and in attributes.
ANGULAR FILTERS
➤ A filter formats the value of an expression for display to the user.
➤ There are 5 built-in filters and we can write our own filters.
➤ Built-in filters are:
➤ uppercase: Format a string to upper case.
➤ lowercase: Format a string to lower case.
➤ currency: Format a number to a currency format.
➤ orderBy: Orders an array by an expression.
➤ filter: Select a subset of items from an array.
SERVICES, FACTORIES AND PROVIDERS
➤ Services, Factories and Providers are for providing data to our application.
➤ They are singletons(unlike controllers that instantiate every time we call them).
Which means there is only one instance of specific Factory in whole application. So
we can share data between controllers.
➤ There is a slight difference between them. Providers and be configured before
application start(some kind of constructor for whole app called config phase).
➤ There are two other type of recipe to define data in AngularJS named ”Value” and
”Constant”. Just to mention.
FACTORY
ROUTING AND TEMPLATES
➤ AngularJS can handle routes by using ngRoute module.
➤ We just need to add angular-route script and add ngRoute as a dependency to our
app module.
➤ Also some configuration need to be done.
JUST A LITTLE BIT MORE ABOUT SCOPES
$BROADCAST, $EMIT, $ON
➤ AngularJS has a great way to communicate between different scopes.
➤ A scope can talk to its child through $broadcast.
➤ It can talk to its parents through $emit.
➤ And everyone can listen to their family using $on.
ANGULAR RESOURCE
➤ AngularJS needs ngResource module to communicate with server.
➤ Dont forget to add ngResource to app dependencies
AngularJS has some great friends to help him grow.
RESOURCES
➤ AngularJS Documentation: http://docs.angularjs.org
➤ Some Good Slides:
➤ Everything you need to know to get started http://goo.gl/sqHKdU
➤ AngularJS Basics with Example http://goo.gl/Bh6D9K
➤ Introduction to AngularJS http://goo.gl/524fTR
➤ Angular Style Guide, John Papa https://goo.gl/ft7Vec
➤ Don’t forget to check Youtube for so many good workshop and tutorials

More Related Content

What's hot

What's hot (20)

Javascript
JavascriptJavascript
Javascript
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
Advanced AngularJS Concepts
Advanced AngularJS ConceptsAdvanced AngularJS Concepts
Advanced AngularJS Concepts
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2 Migrating an application from Angular 1 to Angular 2
Migrating an application from Angular 1 to Angular 2
 
Js ppt
Js pptJs ppt
Js ppt
 
Setting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation FrameworkSetting up Page Object Model in Automation Framework
Setting up Page Object Model in Automation Framework
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
 
Java Script
Java ScriptJava Script
Java Script
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular js
 
J Query
J QueryJ Query
J Query
 
Building End-to-End Apps Using Typescript
Building End-to-End Apps Using TypescriptBuilding End-to-End Apps Using Typescript
Building End-to-End Apps Using Typescript
 
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
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
 
Java script
Java scriptJava script
Java script
 
Migrating an Application from Angular 1 to Angular 2
Migrating an Application from Angular 1 to Angular 2 Migrating an Application from Angular 1 to Angular 2
Migrating an Application from Angular 1 to Angular 2
 

Similar to Everything You Need To Know About AngularJS

AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
Abhishek Anand
 

Similar to Everything You Need To Know About AngularJS (20)

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
Angular js interview question answer for fresher
Angular js interview question answer for fresherAngular js interview question answer for fresher
Angular js interview question answer for fresher
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
introduction to Angularjs basics
introduction to Angularjs basicsintroduction to Angularjs basics
introduction to Angularjs basics
 
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
 
AngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPIAngularJS Fundamentals + WebAPI
AngularJS Fundamentals + WebAPI
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Introduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumarIntroduction to Angularjs : kishan kumar
Introduction to Angularjs : kishan kumar
 
Introduction to Angularjs
Introduction to AngularjsIntroduction to Angularjs
Introduction to Angularjs
 
AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)AngularJS Introduction (Talk given on Aug 5 2013)
AngularJS Introduction (Talk given on Aug 5 2013)
 
Angular js
Angular jsAngular js
Angular js
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
 
Angularjs Basics
Angularjs BasicsAngularjs Basics
Angularjs Basics
 
Angular Basics.pptx
Angular Basics.pptxAngular Basics.pptx
Angular Basics.pptx
 
Ng talk
Ng talkNg talk
Ng talk
 
Introduction to Angular Js
Introduction to Angular JsIntroduction to Angular Js
Introduction to Angular Js
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
Angular js-crash-course
Angular js-crash-courseAngular js-crash-course
Angular js-crash-course
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Everything You Need To Know About AngularJS

  • 1. Everything You Need To Know About By Sina Mirhejazi
  • 2. WHAT IS ? ➤ It’s not a JavaScript Library. There is no function which we can directly call and use. ➤ It’s not a DOM manipulation library like jQuery. But it uses subset of jQuery to manipulation (Called jqLite). ➤ Focus more on HTML side of web apps. ➤ For MVC/MVVM design patterns.
  • 3. PHILOSOPHY ➤ Angular is what HTML could have been if it had been designed for applications. ➤ HTML is a great declarative language for static documents. It does not contain much in the way of creating application. ➤ Building web-applications is an exercise in what do I have to do, so that I trick the browser in to do what I want. ➤ Thats why we have frameworks - set of utility functions and libraries for DOM manipulation. ➤ Angular takes another approach. ➤ Angular teaches the browser new syntax.
  • 4. ➤ One way data binding means creating View once and leave Model behind. Whenever we want to change something, we have to change Model and render View again. ➤ Two way data binding link View and Model together and every changes to each one affect another continuously. ➤ How?
  • 5. WHERE THINGS START? ➤ It all starts when you add angular script to your code. THAT SIMPLE!
  • 6. ANGULAR MODULES ➤ Angular works with modules. ➤ Module for main App. ➤ Module for components. ➤ Muddle for everything.
  • 7. ANGULAR CONTROLLERS ➤ We use a Controller to provide data for our Views. ➤ We should not use Controllers to manipulate DOM.
  • 8. DEPENDENCY INJECTION ➤ DI is a way to tell angular which service needs what. ➤ There are several ways to do this.
  • 9. SCOPE ➤ Scope is a link between controller and view. ➤ We can add properties to our $scope object in controllers and get them on view. ➤ More on Scopes later.
  • 10. ANGULAR DIRECTIVES ➤ Directives are out only chance to manipulate DOM. ➤ Directives can teach HTML new stuff. ➤ They can be attributes, classes(!), comments(!) and even tag elements!!! ➤ We seen a couple of them earlier like: ➤ ng-app ➤ ng-controller ➤ ng-repeat ➤ ng-show
  • 11. ANGULAR DIRECTIVES ➤ ng-app ➤ ng-app specify out main module to run the application. ➤ IT goes on <html> tag. ➤ ng-controller ➤ ng-controller link a controller to part of our DOM. ➤ $scope of controller affect the part of DOM that ng-controller linked to. And It’s child of course.
  • 12. ANGULAR DIRECTIVES ➤ ng-repeat ➤ ng-repeat iterate between items of a given object/array. Just like for…in. ➤ ng-show/ng-hide ➤ These twins get an expression and show/hide whether it’s true or false. ➤ ng-if ➤ This one gets an expression and comment/uncomment the element that contains it.
  • 13. ANGULAR DIRECTIVES ➤ ng-click ➤ ng-click get an expression(usually a function) and fire that expression in case of click. ➤ ng-bind ➤ This one is all awesomeness of AngularJS ➤ ng-bind replace text content of it’s tag with a given expression. ➤ AND change it whenever expression change! ➤ It has a little brother named {{expression}}
  • 14. ANGULAR EXPRESSIONS ➤ What is this expression we keep talking about? ➤ Expression is a snippet of JavaScript code, inside HTML tags and attributes. ➤ They live inside HTML tags under the shield of {{}} and in attributes.
  • 15. ANGULAR FILTERS ➤ A filter formats the value of an expression for display to the user. ➤ There are 5 built-in filters and we can write our own filters. ➤ Built-in filters are: ➤ uppercase: Format a string to upper case. ➤ lowercase: Format a string to lower case. ➤ currency: Format a number to a currency format. ➤ orderBy: Orders an array by an expression. ➤ filter: Select a subset of items from an array.
  • 16. SERVICES, FACTORIES AND PROVIDERS ➤ Services, Factories and Providers are for providing data to our application. ➤ They are singletons(unlike controllers that instantiate every time we call them). Which means there is only one instance of specific Factory in whole application. So we can share data between controllers. ➤ There is a slight difference between them. Providers and be configured before application start(some kind of constructor for whole app called config phase). ➤ There are two other type of recipe to define data in AngularJS named ”Value” and ”Constant”. Just to mention.
  • 18. ROUTING AND TEMPLATES ➤ AngularJS can handle routes by using ngRoute module. ➤ We just need to add angular-route script and add ngRoute as a dependency to our app module. ➤ Also some configuration need to be done.
  • 19. JUST A LITTLE BIT MORE ABOUT SCOPES
  • 20. $BROADCAST, $EMIT, $ON ➤ AngularJS has a great way to communicate between different scopes. ➤ A scope can talk to its child through $broadcast. ➤ It can talk to its parents through $emit. ➤ And everyone can listen to their family using $on.
  • 21. ANGULAR RESOURCE ➤ AngularJS needs ngResource module to communicate with server. ➤ Dont forget to add ngResource to app dependencies
  • 22. AngularJS has some great friends to help him grow.
  • 23. RESOURCES ➤ AngularJS Documentation: http://docs.angularjs.org ➤ Some Good Slides: ➤ Everything you need to know to get started http://goo.gl/sqHKdU ➤ AngularJS Basics with Example http://goo.gl/Bh6D9K ➤ Introduction to AngularJS http://goo.gl/524fTR ➤ Angular Style Guide, John Papa https://goo.gl/ft7Vec ➤ Don’t forget to check Youtube for so many good workshop and tutorials