SlideShare une entreprise Scribd logo
1  sur  42
Beginner’s Workshop
Sathish VJ
History
• Origins within Google, invented by Misko
Hevery
• Open-sourced 2009
• 17,000 lines in 6 months => 1,500 in 3 weeks
Killer Features
•
•
•
•

Two-way binding
Declarative coding for UI
Teaching HTML new tricks
Separation of model & view, No DOM/View
manipulation, less code
• Great for CRUD based single page apps
• Awesome adoption and great community
• Unit testable, E2E testable
Main site, Download
• angularjs.org
Ex 1: ng-app, expression binding
• Download
https://github.com/sathishvj/AngularJSTutoria
ls/archive/master.zip
• Extract locally
• Go to 01-ngApp-binding
• Open html in browser
• Examine source code
Ex 1: ng-app, expression binding
Ex 1: ng-app, expression binding
• Include angular.js or angular.min.js
• Add ng-app declarative where you want
Angular to manage app (typically <html> or
<body>)
• Expression binding with {{ }}
• ng-app can also be written as ngApp
• Use camel case in JavaScript code (ngApp) and
use snake case in html (ng-app)
How does it work
• Compile: traverse the DOM and collect all of
the directives. The result is a linking function.
• Link: combine the directives with a scope and
produce a live view.
Ex 2: ngModel, binding variables
• 02-ngModel
• ng-model binds variable data. It can be
declared on input, select, textarea, etc.
Two-way data binding
Other in-built declarations in Angular
ngApp ngBind ngBindHtml ngBindTemplate ngBlur
ngChange ngChecked ngClass ngClassEven
ngClassOdd ngClick ngCloak ngController ngCopy
ngCsp ngCut ngDblclick ngDisabled ngFocus ngForm
ngHide ngHref ngIf ngInclude ngInit ngKeydown
ngKeypress ngKeyup ngList ngModel ngMousedown
ngMouseenter ngMouseleave ngMousemove
ngMouseover ngMouseup ngNonBindable ngOpen
ngPaste ngPluralize ngReadonly ngRepeat
ngSelected ngShow ngSrc ngSrcset ngStyle
ngSubmit ngSwitch ngTransclude ngValue
Ex 3: jquery comparison
• 03-jquerycomparison
Differences from jQuery
• Declarative code, not imperative (explicitly
stating, say with functions, what action needs
to be performed)
• Automatic data binding
• No direct DOM manipulation
Ex 04: More expressions
Expressions
• Expressions can be embedded anywhere
• … even for class values
• There are special filters that you can use
(currency)
• Values are automatically bound
MVC
Ex 05: Scope and Controller
Learnings
• Controller objects can separate data and
functionality
– There can be many controllers

• ‘$scope’ is injected by AngularJS
• $scope.data in the controller is referred to as
simply data in html
• Dot notation for object members works
(person.age)
– In fact, this is suggested practice
Scope, Controller, View
How AngularJS does MVC
Dependency Injection
Dependency Injection
Ex 07: Method on Scope
Ex 08: ngClick
Ex 09: ngRepeat
Ex 09: ngRepeat
Ex 10: Filters
Other inbuilt filters
Modules in AngularJS
• Third party code can be packaged as reusable
modules.
• The modules can be loaded in any/parallel
order (due to delayed nature of module
execution).
• Some Angular modules are in separate files:
Eg. ngRoute is in angularjs-route.min.js
Ex 11: ngView and Routing
ngView and Routing
• This part requires a web server
– I’ve created a simple one at
https://github.com/sathishvj/gowebserver
– Run suitable executable in index.html directory

• You can load different views contained in
partial html files based on address bar
location and apply specific controllers to it
Ex 12: $http
$http
• Make AJAX calls with $http
• It returns deferred promises
– More in later workshops

• You can handle ‘success’ and ‘error’
Working with angular-seed
• https://github.com/angular/angular-seed
• You need to have node.js installed to test
Ex 13: Custom Filter
Ex 14: Custom Directive
• -customdirective
What we didn’t cover
•
•
•
•
•

Unit testing, E2E testing
Custom directives beyond basics
$apply and digest cycles
$q and promises
Service, Factory, Provider
Resources
•
•
•
•
•
•

angularjs.org
Google Groups: AngularJS
Google+: AngularJS
ngmodules.org
Github: angular-ui.github.io
Google+: AngularJS India
Project
• Build an app to list tweets given a search string
(might require sign-up to Twitter API)

• Two pages required – main and an about page
thank you
sathishvj

questions?
AngularJS Beginners Workshop
AngularJS Beginners Workshop

Contenu connexe

Tendances

Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginnersMunir Hoque
 
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)Gary Arora
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular jsTamer Solieman
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJSInfragistics
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practicesHenry Tao
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJSDavid Parsons
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish MinutesDan Wahlin
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework Sakthi Bro
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation Phan Tuan
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSSimon Guest
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slidessamhelman
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBApaichon Punopas
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introductionLuigi De Russis
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 

Tendances (20)

AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
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)
 
Introduction of angular js
Introduction of angular jsIntroduction of angular js
Introduction of angular js
 
Step by Step - AngularJS
Step by Step - AngularJSStep by Step - AngularJS
Step by Step - AngularJS
 
AngularJS best-practices
AngularJS best-practicesAngularJS best-practices
AngularJS best-practices
 
Introduction to Angular JS
Introduction to Angular JSIntroduction to Angular JS
Introduction to Angular JS
 
Angular js
Angular jsAngular js
Angular js
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
Why angular js Framework
Why angular js Framework Why angular js Framework
Why angular js Framework
 
Angular js PPT
Angular js PPTAngular js PPT
Angular js PPT
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Advanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JSAdvanced Tips & Tricks for using Angular JS
Advanced Tips & Tricks for using Angular JS
 
Angular js tutorial slides
Angular js tutorial slidesAngular js tutorial slides
Angular js tutorial slides
 
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDBDynamic Application Development by NodeJS ,AngularJS with OrientDB
Dynamic Application Development by NodeJS ,AngularJS with OrientDB
 
Angular js
Angular jsAngular js
Angular js
 
AngularJS: an introduction
AngularJS: an introductionAngularJS: an introduction
AngularJS: an introduction
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 

En vedette

FrontEnd platform based on AngularJS
FrontEnd platform based on AngularJSFrontEnd platform based on AngularJS
FrontEnd platform based on AngularJSEgor Miasnikov
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS InternalEyal Vardi
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & providerCorley S.r.l.
 
Building Modern Web Apps with AngularJS
Building Modern Web Apps with AngularJSBuilding Modern Web Apps with AngularJS
Building Modern Web Apps with AngularJSRaveen Perera
 
III - Better angularjs
III - Better angularjsIII - Better angularjs
III - Better angularjsWebF
 
Scope demystified - AngularJS
Scope demystified - AngularJSScope demystified - AngularJS
Scope demystified - AngularJSSumanth krishna
 
Angular 1.5 Components
Angular 1.5 ComponentsAngular 1.5 Components
Angular 1.5 ComponentsJosé Barbosa
 
Creating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web ComponentsCreating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web ComponentsRachael L Moore
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS ArchitectureEyal Vardi
 

En vedette (12)

FrontEnd platform based on AngularJS
FrontEnd platform based on AngularJSFrontEnd platform based on AngularJS
FrontEnd platform based on AngularJS
 
AngularJS Internal
AngularJS InternalAngularJS Internal
AngularJS Internal
 
AngularJS: Service, factory & provider
AngularJS: Service, factory & providerAngularJS: Service, factory & provider
AngularJS: Service, factory & provider
 
Dependency injection
Dependency injectionDependency injection
Dependency injection
 
Building Modern Web Apps with AngularJS
Building Modern Web Apps with AngularJSBuilding Modern Web Apps with AngularJS
Building Modern Web Apps with AngularJS
 
III - Better angularjs
III - Better angularjsIII - Better angularjs
III - Better angularjs
 
Scope demystified - AngularJS
Scope demystified - AngularJSScope demystified - AngularJS
Scope demystified - AngularJS
 
Angular 1.5 Components
Angular 1.5 ComponentsAngular 1.5 Components
Angular 1.5 Components
 
AngularJs Crash Course
AngularJs Crash CourseAngularJs Crash Course
AngularJs Crash Course
 
Creating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web ComponentsCreating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web Components
 
Introduction to AngularJs
Introduction to AngularJsIntroduction to AngularJs
Introduction to AngularJs
 
AngularJS Architecture
AngularJS ArchitectureAngularJS Architecture
AngularJS Architecture
 

Similaire à AngularJS Beginners Workshop

Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupGoutam Dey
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSTom Borger
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Ganesh Kondal
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSGil Fink
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - IntroductionSenthil Kumar
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic ConceptHari Haran
 
Advanced AngularJS Tips and Tricks
Advanced AngularJS Tips and TricksAdvanced AngularJS Tips and Tricks
Advanced AngularJS Tips and TricksJeremy Likness
 
Angularjs beginners-workshop1
Angularjs beginners-workshop1Angularjs beginners-workshop1
Angularjs beginners-workshop1Jugnu Sharma
 
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.comWhen to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.comPerfomatix Solutions
 
Angular patterns
Angular patternsAngular patterns
Angular patternsPremkumar M
 
Angular js for enteprise application
Angular js for enteprise applicationAngular js for enteprise application
Angular js for enteprise applicationvu van quyet
 

Similaire à AngularJS Beginners Workshop (20)

Angularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetupAngularjs for kolkata drupal meetup
Angularjs for kolkata drupal meetup
 
Angular js
Angular jsAngular js
Angular js
 
Integrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMSIntegrating AngularJS into the Campus CMS
Integrating AngularJS into the Campus CMS
 
Angularjs
AngularjsAngularjs
Angularjs
 
Angular js
Angular jsAngular js
Angular js
 
Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5Tech io spa_angularjs_20130814_v0.9.5
Tech io spa_angularjs_20130814_v0.9.5
 
End to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJSEnd to-End SPA Development Using ASP.NET and AngularJS
End to-End SPA Development Using ASP.NET and AngularJS
 
Angular js
Angular jsAngular js
Angular js
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
AngularJS
AngularJSAngularJS
AngularJS
 
Valentine with Angular js - Introduction
Valentine with Angular js - IntroductionValentine with Angular js - Introduction
Valentine with Angular js - Introduction
 
Angular js for Beginnners
Angular js for BeginnnersAngular js for Beginnners
Angular js for Beginnners
 
AngularJs Basic Concept
AngularJs Basic ConceptAngularJs Basic Concept
AngularJs Basic Concept
 
Advanced AngularJS Tips and Tricks
Advanced AngularJS Tips and TricksAdvanced AngularJS Tips and Tricks
Advanced AngularJS Tips and Tricks
 
Angular js
Angular jsAngular js
Angular js
 
Angularjs beginners-workshop1
Angularjs beginners-workshop1Angularjs beginners-workshop1
Angularjs beginners-workshop1
 
AngularJS
AngularJSAngularJS
AngularJS
 
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.comWhen to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
When to use and when not to use AngularJS - Liju Pillai, www.perfomatix.com
 
Angular patterns
Angular patternsAngular patterns
Angular patterns
 
Angular js for enteprise application
Angular js for enteprise applicationAngular js for enteprise application
Angular js for enteprise application
 

Plus de Sathish VJ

Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopSathish VJ
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientSathish VJ
 
Blockchain, bitcoin
Blockchain, bitcoinBlockchain, bitcoin
Blockchain, bitcoinSathish VJ
 
Apps and Hacks Showreel
Apps and Hacks ShowreelApps and Hacks Showreel
Apps and Hacks ShowreelSathish VJ
 
Microsoft Ventures Hackday 2014 Bangalore - Limitless App
Microsoft Ventures Hackday 2014 Bangalore - Limitless AppMicrosoft Ventures Hackday 2014 Bangalore - Limitless App
Microsoft Ventures Hackday 2014 Bangalore - Limitless AppSathish VJ
 
Smart Ride - our winning Internet of Things hack at the weekend Apigee hackathon
Smart Ride - our winning Internet of Things hack at the weekend Apigee hackathonSmart Ride - our winning Internet of Things hack at the weekend Apigee hackathon
Smart Ride - our winning Internet of Things hack at the weekend Apigee hackathonSathish VJ
 
Google AppEngine - For GBG Bangalore
Google AppEngine - For GBG BangaloreGoogle AppEngine - For GBG Bangalore
Google AppEngine - For GBG BangaloreSathish VJ
 
Internet of Things GDG Bangalore 2013
Internet of Things GDG Bangalore 2013Internet of Things GDG Bangalore 2013
Internet of Things GDG Bangalore 2013Sathish VJ
 

Plus de Sathish VJ (9)

Why Go Lang?
Why Go Lang?Why Go Lang?
Why Go Lang?
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
 
gething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang clientgething started - ethereum & using the geth golang client
gething started - ethereum & using the geth golang client
 
Blockchain, bitcoin
Blockchain, bitcoinBlockchain, bitcoin
Blockchain, bitcoin
 
Apps and Hacks Showreel
Apps and Hacks ShowreelApps and Hacks Showreel
Apps and Hacks Showreel
 
Microsoft Ventures Hackday 2014 Bangalore - Limitless App
Microsoft Ventures Hackday 2014 Bangalore - Limitless AppMicrosoft Ventures Hackday 2014 Bangalore - Limitless App
Microsoft Ventures Hackday 2014 Bangalore - Limitless App
 
Smart Ride - our winning Internet of Things hack at the weekend Apigee hackathon
Smart Ride - our winning Internet of Things hack at the weekend Apigee hackathonSmart Ride - our winning Internet of Things hack at the weekend Apigee hackathon
Smart Ride - our winning Internet of Things hack at the weekend Apigee hackathon
 
Google AppEngine - For GBG Bangalore
Google AppEngine - For GBG BangaloreGoogle AppEngine - For GBG Bangalore
Google AppEngine - For GBG Bangalore
 
Internet of Things GDG Bangalore 2013
Internet of Things GDG Bangalore 2013Internet of Things GDG Bangalore 2013
Internet of Things GDG Bangalore 2013
 

Dernier

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Dernier (20)

TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

AngularJS Beginners Workshop

  • 2. History • Origins within Google, invented by Misko Hevery • Open-sourced 2009 • 17,000 lines in 6 months => 1,500 in 3 weeks
  • 3. Killer Features • • • • Two-way binding Declarative coding for UI Teaching HTML new tricks Separation of model & view, No DOM/View manipulation, less code • Great for CRUD based single page apps • Awesome adoption and great community • Unit testable, E2E testable
  • 4. Main site, Download • angularjs.org
  • 5. Ex 1: ng-app, expression binding • Download https://github.com/sathishvj/AngularJSTutoria ls/archive/master.zip • Extract locally • Go to 01-ngApp-binding • Open html in browser • Examine source code
  • 6. Ex 1: ng-app, expression binding
  • 7. Ex 1: ng-app, expression binding • Include angular.js or angular.min.js • Add ng-app declarative where you want Angular to manage app (typically <html> or <body>) • Expression binding with {{ }} • ng-app can also be written as ngApp • Use camel case in JavaScript code (ngApp) and use snake case in html (ng-app)
  • 8. How does it work • Compile: traverse the DOM and collect all of the directives. The result is a linking function. • Link: combine the directives with a scope and produce a live view.
  • 9. Ex 2: ngModel, binding variables • 02-ngModel • ng-model binds variable data. It can be declared on input, select, textarea, etc.
  • 11. Other in-built declarations in Angular ngApp ngBind ngBindHtml ngBindTemplate ngBlur ngChange ngChecked ngClass ngClassEven ngClassOdd ngClick ngCloak ngController ngCopy ngCsp ngCut ngDblclick ngDisabled ngFocus ngForm ngHide ngHref ngIf ngInclude ngInit ngKeydown ngKeypress ngKeyup ngList ngModel ngMousedown ngMouseenter ngMouseleave ngMousemove ngMouseover ngMouseup ngNonBindable ngOpen ngPaste ngPluralize ngReadonly ngRepeat ngSelected ngShow ngSrc ngSrcset ngStyle ngSubmit ngSwitch ngTransclude ngValue
  • 12. Ex 3: jquery comparison • 03-jquerycomparison
  • 13. Differences from jQuery • Declarative code, not imperative (explicitly stating, say with functions, what action needs to be performed) • Automatic data binding • No direct DOM manipulation
  • 14. Ex 04: More expressions
  • 15. Expressions • Expressions can be embedded anywhere • … even for class values • There are special filters that you can use (currency) • Values are automatically bound
  • 16. MVC
  • 17. Ex 05: Scope and Controller
  • 18. Learnings • Controller objects can separate data and functionality – There can be many controllers • ‘$scope’ is injected by AngularJS • $scope.data in the controller is referred to as simply data in html • Dot notation for object members works (person.age) – In fact, this is suggested practice
  • 23. Ex 07: Method on Scope
  • 29. Modules in AngularJS • Third party code can be packaged as reusable modules. • The modules can be loaded in any/parallel order (due to delayed nature of module execution). • Some Angular modules are in separate files: Eg. ngRoute is in angularjs-route.min.js
  • 30. Ex 11: ngView and Routing
  • 31. ngView and Routing • This part requires a web server – I’ve created a simple one at https://github.com/sathishvj/gowebserver – Run suitable executable in index.html directory • You can load different views contained in partial html files based on address bar location and apply specific controllers to it
  • 33. $http • Make AJAX calls with $http • It returns deferred promises – More in later workshops • You can handle ‘success’ and ‘error’
  • 34. Working with angular-seed • https://github.com/angular/angular-seed • You need to have node.js installed to test
  • 35. Ex 13: Custom Filter
  • 36. Ex 14: Custom Directive • -customdirective
  • 37. What we didn’t cover • • • • • Unit testing, E2E testing Custom directives beyond basics $apply and digest cycles $q and promises Service, Factory, Provider
  • 38. Resources • • • • • • angularjs.org Google Groups: AngularJS Google+: AngularJS ngmodules.org Github: angular-ui.github.io Google+: AngularJS India
  • 39. Project • Build an app to list tweets given a search string (might require sign-up to Twitter API) • Two pages required – main and an about page

Notes de l'éditeur

  1. they start with an anecdote, discussing how they were working on a web application at Google. They have already written 17000 lines of code in about 6 months and it was almost finished, albeit with great frustration related to development speed and testability. This guy, MiškoHevery, tells everyone that by using a framework that he wrote in his spare time (you gotta love devs!) they could rewrite the whole application in two weeks. He was wrong, they did it in three weeks and at the end the whole thing has only 1500 lines of code and was fully testable. 90% less code, in 90% less time. And it was very testable.
  2. CompilerCompiler is an angular service which traverses the DOM looking for attributes. The compilation process happens into two phases.Compile: traverse the DOM and collect all of the directives. The result is a linking function.Link: combine the directives with a scope and produce a live view. Any changes in the scope model are reflected in the view, and any user interactions with the view are reflected in the scope model. Making the scope model a single source of truth.Some directives such ng-repeat clone DOM elements once for each item in collection. Having a compile and link phase improves performance since the cloned template only needs to be compiled once, and then linked once for each clone instance.
  3. http://slid.es/neenhouse/dependency-injection-in-angularjs
  4. http://slid.es/neenhouse/dependency-injection-in-angularjs