SlideShare ist ein Scribd-Unternehmen logo
1 von 27
Downloaden Sie, um offline zu lesen
Hiten Pratap Singh
http://github.com/hitenpratap
http://hprog99.wordpress.com
AngularJS from novice to
professional
Agenda
1. What is AngularJS?
2. Core features
3. It's working
4. How to start working with it?
5. Controller
6. AngularJS directives
7. Expression
8. Forms
9. Services
Agenda
10. Modules
9. Routing
10. Scope
11. Dependency Injection
12. Filters
13. Advantages and disadvantages
14. References
15. Q/A
16. Quiz
What's AngularJS?
AngularJS (commonly referred to as "Angular") is an
open-source web application framework maintained by
Google to address many of the challenges encountered
in developing single-page applications. It aims to simplify
both the development and the testing of such
applications by providing a framework for client-side
model–view–controller (MVC) – As per Wikipedia.
Core features
1.Two way data binding
2.Templates
3.Model view controller(MVC)
4.Dependency Injection
Two Way Data Binding
Templates
 In AngularJS, a template is just plain-old-HTML. The
HTML vocabulary is extended, to contain instructions
on how the model should be projected into the view.
 The HTML templates are parsed by the browser into
the DOM. The DOM then becomes the input to the
AngularJS compiler. AngularJS traverses the DOM
template for rendering instructions, which are called
directives. Collectively, the directives are responsible
for setting up the data-binding for your application
view.
Model View Controller(MVC or MVVC)
Dependency Injection
AngularJS Working
Hello World - AngularJS
AngularJS Controller
AngularJS Directives
 ng-app: Declares an element as root element
 ng-bind: Automatically changes the text of HTML element
 ng-model: Similar to ng-bind but allow two way binding
 ng-class: Allow class attribute to be dynaically loaded
 ng-controller: Specifies javascript controller class
 ng-repeat: Instantiate an element once per item from a collection
 ng-show & ng-hide: Conditionally show or hide an element
 ng-switch: Conditionally instantiate one template from a list
 ng-view: Rendering templates driven by specific controllers
 ng-if: Simple if-else attribute that we know from ever!
AngularJS Expression
Angular Form Properties $valid, $invalid, $pristine, $dirty
Angular also provides classes on the form and its inputs so that
you can style each state accordingly.
AngularJS Services
In Angular a service is a function or an object and is used to share data
and/or behavior across controllers, directives, filters, other services etc. A
service is treated as a singleton, that is there is only one instance of a
specific service available during the whole lifetime of the Angular
application. This is different from e.g. a controller of which many
instances can be created.
The easiest way is to use the Service recipe of an angular module.
var app = angular.module('app', []);
app.service('some-service', function(){…});
Other two methods/way to create service are:
1. The factory recipe
2.The provider recipe
AngularJS Module
AngularJS Routing
AngularJS Scope
AngularJS Dependency Injection
AngularJS has a built-in dependency injection subsystem that
helps the developer by making the application easier to develop,
understand, and test.
Dependency Injection (DI) allows you to ask for your
dependencies, rather than having to go look for them or make
them yourself. Think of it as a way of saying "Hey I need X', and
the DI is responsible for creating and providing it for you.
To gain access to core AngularJS services, it is simply a matter of
adding that service as a parameter; AngularJS will detect that you
need that service and provide an instance for you.
AngularJS Filters
Angular exposes a simple API for creating a filter. Just as you
would declare a controller with app.controller(‘myCtrl',
function(){});, you can create a new filter by appending
.filter(‘filterName', function(){}) to your Angular app.
AngularJS Advantages
 Super fast development
 Makes developing SPA easy
 Awesome performance
 Make apps scalable
 Data binding and DOM manipulation
AngularJS Disadvantages
 Good for I/O driven apps only(not games)
 Angular is big and complicated. With multiple ways to do
the same thing it is hard to tell which way is better for
particular task.
 The lifecycle of Angular application is complex, and to
master it you really need to read the code.
References
 AngularJS Docs(https://docs.angularjs.org/tutorial)
 AngularJS API Reference(https://docs.angularjs.org/api)
 AngularJS Code School(http://angular.codeschool.com/)
 ng-newsletter(http://www.ng-newsletter.com/books/)
Discussion Session
QUERIES ?
Hiten Pratap Singh
http://github.com/hitenpratap
http://hprog99.wordpress.com
Quiz Time
Anyone have any suggestons about what it should be? If no
then
We'll build an online contact manager just like
Google Contact.

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
KMS Technology
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
guest11106b
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
Guo Albert
 

Was ist angesagt? (20)

Angular introduction students
Angular introduction studentsAngular introduction students
Angular introduction students
 
Introduction To Single Page Application
Introduction To Single Page ApplicationIntroduction To Single Page Application
Introduction To Single Page Application
 
Use Node.js to create a REST API
Use Node.js to create a REST APIUse Node.js to create a REST API
Use Node.js to create a REST API
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
 
Hibernate Presentation
Hibernate  PresentationHibernate  Presentation
Hibernate Presentation
 
Angular 8
Angular 8 Angular 8
Angular 8
 
AngularJS for Beginners
AngularJS for BeginnersAngularJS for Beginners
AngularJS for Beginners
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Java Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By StepJava Persistence API (JPA) Step By Step
Java Persistence API (JPA) Step By Step
 
What Is Virtual DOM In React JS.pptx
What Is Virtual DOM In React JS.pptxWhat Is Virtual DOM In React JS.pptx
What Is Virtual DOM In React JS.pptx
 
SOLID Design Principles
SOLID Design PrinciplesSOLID Design Principles
SOLID Design Principles
 
Angular Data Binding
Angular Data BindingAngular Data Binding
Angular Data Binding
 
Training On Angular Js
Training On Angular JsTraining On Angular Js
Training On Angular Js
 
Object Oriented Programming In JavaScript
Object Oriented Programming In JavaScriptObject Oriented Programming In JavaScript
Object Oriented Programming In JavaScript
 
Reactjs
Reactjs Reactjs
Reactjs
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5
 
Angular
AngularAngular
Angular
 
Introduction of Html/css/js
Introduction of Html/css/jsIntroduction of Html/css/js
Introduction of Html/css/js
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 

Andere mochten auch

Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
Harbinger Systems - HRTech Builder of Choice
 

Andere mochten auch (13)

A different thought AngularJS
A different thought AngularJSA different thought AngularJS
A different thought AngularJS
 
Requirements Bazaar powered by AngularJS and Polymer - Talk at Google Develop...
Requirements Bazaar powered by AngularJS and Polymer - Talk at Google Develop...Requirements Bazaar powered by AngularJS and Polymer - Talk at Google Develop...
Requirements Bazaar powered by AngularJS and Polymer - Talk at Google Develop...
 
SharePoint Saturday Paris 2016 - AngularJS with the Microsoft Graph
SharePoint Saturday Paris 2016 - AngularJS with the Microsoft GraphSharePoint Saturday Paris 2016 - AngularJS with the Microsoft Graph
SharePoint Saturday Paris 2016 - AngularJS with the Microsoft Graph
 
Single page application
Single page applicationSingle page application
Single page application
 
Let your website a ride of AngularJS
Let your website a ride of AngularJSLet your website a ride of AngularJS
Let your website a ride of AngularJS
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
AngularJS
AngularJSAngularJS
AngularJS
 
Angular js
Angular jsAngular js
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
 
Benefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular jsBenefits of developing single page web applications using angular js
Benefits of developing single page web applications using angular js
 
AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)AngularJS - What is it & Why is it awesome ? (with demos)
AngularJS - What is it & Why is it awesome ? (with demos)
 
Benefits of developing a Single Page Web Applications using AngularJS
Benefits of developing a Single Page Web Applications using AngularJSBenefits of developing a Single Page Web Applications using AngularJS
Benefits of developing a Single Page Web Applications using AngularJS
 
Design pattern architetturali Model View Controller, MVP e MVVM
Design pattern architetturali   Model View Controller, MVP e MVVMDesign pattern architetturali   Model View Controller, MVP e MVVM
Design pattern architetturali Model View Controller, MVP e MVVM
 

Ähnlich wie AngularJS

Ähnlich wie AngularJS (20)

Intoduction to Angularjs
Intoduction to AngularjsIntoduction to Angularjs
Intoduction to Angularjs
 
AngularJS in practice
AngularJS in practiceAngularJS in practice
AngularJS in practice
 
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
 
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
 
Angular js slides
Angular js slidesAngular js slides
Angular js slides
 
AngularJs (1.x) Presentation
AngularJs (1.x) PresentationAngularJs (1.x) Presentation
AngularJs (1.x) Presentation
 
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescriptangularjs-vs-angular-the-key-differences-between-javascript-and-typescript
angularjs-vs-angular-the-key-differences-between-javascript-and-typescript
 
One Weekend With AngularJS
One Weekend With AngularJSOne Weekend With AngularJS
One Weekend With AngularJS
 
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
 
Kalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js TutorialsKalp Corporate Angular Js Tutorials
Kalp Corporate Angular Js Tutorials
 
Angular Project Report
 Angular Project Report Angular Project Report
Angular Project Report
 
Angularjs overview
Angularjs  overviewAngularjs  overview
Angularjs overview
 
Angular js getting started
Angular js getting startedAngular js getting started
Angular js getting started
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
 
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?
 
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdfangularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
angularjs_vs_angular_the_key_differences_between_javascript_and_typescript.pdf
 
Angular
AngularAngular
Angular
 
angular
angularangular
angular
 
angular content
angular contentangular content
angular content
 
angular
angularangular
angular
 

Kürzlich hochgeladen

Kürzlich hochgeladen (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
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...
 
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
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

AngularJS

  • 2. AngularJS from novice to professional
  • 3. Agenda 1. What is AngularJS? 2. Core features 3. It's working 4. How to start working with it? 5. Controller 6. AngularJS directives 7. Expression 8. Forms 9. Services
  • 4. Agenda 10. Modules 9. Routing 10. Scope 11. Dependency Injection 12. Filters 13. Advantages and disadvantages 14. References 15. Q/A 16. Quiz
  • 5. What's AngularJS? AngularJS (commonly referred to as "Angular") is an open-source web application framework maintained by Google to address many of the challenges encountered in developing single-page applications. It aims to simplify both the development and the testing of such applications by providing a framework for client-side model–view–controller (MVC) – As per Wikipedia.
  • 6. Core features 1.Two way data binding 2.Templates 3.Model view controller(MVC) 4.Dependency Injection
  • 7. Two Way Data Binding
  • 8. Templates  In AngularJS, a template is just plain-old-HTML. The HTML vocabulary is extended, to contain instructions on how the model should be projected into the view.  The HTML templates are parsed by the browser into the DOM. The DOM then becomes the input to the AngularJS compiler. AngularJS traverses the DOM template for rendering instructions, which are called directives. Collectively, the directives are responsible for setting up the data-binding for your application view.
  • 12. Hello World - AngularJS
  • 14. AngularJS Directives  ng-app: Declares an element as root element  ng-bind: Automatically changes the text of HTML element  ng-model: Similar to ng-bind but allow two way binding  ng-class: Allow class attribute to be dynaically loaded  ng-controller: Specifies javascript controller class  ng-repeat: Instantiate an element once per item from a collection  ng-show & ng-hide: Conditionally show or hide an element  ng-switch: Conditionally instantiate one template from a list  ng-view: Rendering templates driven by specific controllers  ng-if: Simple if-else attribute that we know from ever!
  • 16. Angular Form Properties $valid, $invalid, $pristine, $dirty Angular also provides classes on the form and its inputs so that you can style each state accordingly.
  • 17. AngularJS Services In Angular a service is a function or an object and is used to share data and/or behavior across controllers, directives, filters, other services etc. A service is treated as a singleton, that is there is only one instance of a specific service available during the whole lifetime of the Angular application. This is different from e.g. a controller of which many instances can be created. The easiest way is to use the Service recipe of an angular module. var app = angular.module('app', []); app.service('some-service', function(){…}); Other two methods/way to create service are: 1. The factory recipe 2.The provider recipe
  • 21. AngularJS Dependency Injection AngularJS has a built-in dependency injection subsystem that helps the developer by making the application easier to develop, understand, and test. Dependency Injection (DI) allows you to ask for your dependencies, rather than having to go look for them or make them yourself. Think of it as a way of saying "Hey I need X', and the DI is responsible for creating and providing it for you. To gain access to core AngularJS services, it is simply a matter of adding that service as a parameter; AngularJS will detect that you need that service and provide an instance for you.
  • 22. AngularJS Filters Angular exposes a simple API for creating a filter. Just as you would declare a controller with app.controller(‘myCtrl', function(){});, you can create a new filter by appending .filter(‘filterName', function(){}) to your Angular app.
  • 23. AngularJS Advantages  Super fast development  Makes developing SPA easy  Awesome performance  Make apps scalable  Data binding and DOM manipulation
  • 24. AngularJS Disadvantages  Good for I/O driven apps only(not games)  Angular is big and complicated. With multiple ways to do the same thing it is hard to tell which way is better for particular task.  The lifecycle of Angular application is complex, and to master it you really need to read the code.
  • 25. References  AngularJS Docs(https://docs.angularjs.org/tutorial)  AngularJS API Reference(https://docs.angularjs.org/api)  AngularJS Code School(http://angular.codeschool.com/)  ng-newsletter(http://www.ng-newsletter.com/books/)
  • 26. Discussion Session QUERIES ? Hiten Pratap Singh http://github.com/hitenpratap http://hprog99.wordpress.com
  • 27. Quiz Time Anyone have any suggestons about what it should be? If no then We'll build an online contact manager just like Google Contact.