SlideShare ist ein Scribd-Unternehmen logo
1 von 28
AngularJS: How, Why &
What’s the difference?
Shyam Seshadri
Director, Fundoo Solutions
“Who are you again??”
–Most people I meet
I am
•

Xoogler - Feedback &
AngularJS team

•

MBA, ISB Hyderabad

•

Author, AngularJS, O’Reilly

•

Director, Fundoo Solutions

•

Part time AngularJS
Trainer

•

Coder / Geek
History
•

Started when JS was sexy, but hard to manage

•

Google Feedback, in GWT Hell

•

Every framework / language had some good things
•

Flex with Data binding (one-way, though)

•

Ruby routes

•

Java with Dependency Injection & Testability
“Hey, I built a framework to learn Javascript in
my free time. We should totally use it.”

–Misko Hevery, Founder of AngularJS
So what is
Open Source,
Open Source,
Javascript
Javascript

Extension
Extension
friendly
friendly

Declarative,
Declarative,
MVVW
MVVW

Extends
Extends
HTML
HTML

Great
Great
Community
Community

To Create
To Create
Amazing Web
Amazing Web
Apps
Apps
The promised land?
THE PROMISE

THE RESULT

REDUCED LINES OF CODE

From 20,000 to 1500!!

FASTER DEVELOPMENT

6 months, GWT = 3 weeks,
AngularJS
Increased Velocity!!

TESTABLE, MAINTAINABLE JS

Dependency Injection & S
uper
Fast Unit Testing

EASIER TEMPLATING & STYLING

Templates pure HTML, CS
S
 &
Designer friendly

INTEGRATE WITH OTHER
LIBRARIES

Directives! Extend HTML and
teach it new tricks!
Advantages - Developer
HTML + JS
HTML + JS

Data Binding
Data Binding

Dependency Injection
Dependency Injection

Custom Components
Custom Components

Super Easy Testing
Super Easy Testing

Amazing Community!
Amazing Community!
The Result?
Drastically Less Lines
Drastically Less Lines
of Code
of Code

Focus on your core,
Focus on your core,
not the crap
not the crap

More maintainable,
More maintainable,
extensible
extensible

Component friendly
Component friendly

Well Tested, Robust
Well Tested, Robust

Designer Friendly
Designer Friendly
Requirements?
•

The same requirements that jQuery has

•

A Server!! (Sometimes…)

•

Works well with Java, as well as with Ruby, Python, etc.
•
•

•

Really independent of the Server
Needs a way of fetching and storing Data (XHR, Sockets…)

Easier if it talks JSON

But not required
• Can transform requests and responses
• No JSON? No problem!
•
Starting an AngularJS
Project
<html ng-app>
<head>
<script src=“angular.min.js”></script>
</head>
<body>
<input type=“text” ng-model=“name”>
<h1>Hello {{name}}</h1>
</body>
</html>
Who’s using AngularJS?

•
•
•
•

•
•
•
•

Google (of course!)

Double Click for Advertisers
Youtube
And many more

Amazon
Netflix
Banks
Lots of startups
Future Plans
•

A Revamped Change Detection Algorithm

•

Web Components Interop

•

A Better Data Persistence story

•

Awesomer Dependency Injection

•

Nicer Logging

•

And a whole lot more
What have I worked with
AngularJS on?
Prototyping
Prototyping

EPG Application
EPG Application

Mail Application
Mail Application

Wedding & Photography
Wedding & Photography

E-Commerce, Analytics
E-Commerce, Analytics
& more
& more
Thinking the AngularJS way!
or how to get the most out of AngularJS
or how to get the most out of AngularJS
“There are many steps to AngularJS Nirvana.
Here are some to make sure you get there!”

–Me!!
1. Model is the Truth!
Model comes from the server
Model comes from the server

Controller manipulates it
Controller manipulates it

View displays it
View displays it

Need to update the view?
Need to update the view?

Update the
Update the
model!!
model!!
Tabs in jQuery
<ul class="tabs">
<li class="tab1 selected">Tab 1</li>
<li class="tab2">Tab 2</li>
</ul>
<div class="tab1">Content for Tab 1</div>
<div class="tab2">Content for Tab 2</div>
Plus
•Tab highlighting logic
•Tab content logic
•Not declarative!!
Tabs leveraging Data binding
<ul class="tabs”>
<li class="tab1" ng-class="{selected: isSelected(‘tab1’)}”>Tab 1</li>
<li class="tab2" ng-class="{selected: isSelected(‘tab2')}">Tab 2</li>
</ul>
<div class="tab1" ng-show="isSelected('tab1')">Content Tab 1</div>
<div class="tab2" ng-show="isSelected('tab2')">Content Tab 2</div>
$scope.isSelected = function(tab) {
return tab === currentTab;
};
Tabs in AngularJS
Or even better, do this:
<tabs>
<tab title=“My First Tab”>Tab 1 content here</tab>
<tab title=“My Second Tab”>Tab 2 content
here</tab>
</tabs>
2. Leverage Data-binding
Why do
this?
<form id="my-form”>
<input type="text" id="nameField”>
<input type="email" id="emailField”>
<button>Submit</button>
</form>
function setFormValues(userDetails) {
$('#nameField').value(userDetails.name);
$('#emailField').value(userDetails.email);
}
// GETTING ALSO…

When you can do
this?
<form id="my-form”>
<input type="text"
id="nameField”
ng-model="user.name”>
<input type="email"
id="emailField”
ng-model="user.email”>
<button>Submit</button>
</form>

$scope.user
3. DOM Manipulation —>
Directives
Don’t do this
in your
controller

$('#inputDate').datepicker();
$('#inputDate')
.datepicker('getDate');
$('#inputDate')
.datepicker('setDate’,
'05/23/1975');

Instead, create a
directive

<input type="text”
jqui-datepicker
ng-model="startDate”
date-format=
"DD/mm/YYYY”
on-select=
”dateSelected(date)”>
Lack of
Lack of
compiler
compiler

Prevent
Prevent
Regressions
Regressions

“4.) Test Early, Test Often, and Keep testing”
Reduce manual
Reduce manual
labor, increase
labor, increase
turnaround
turnaround

–Some Wise Guru

Specification for
Specification for
the code
the code
5.) Separate Biz. Logic vs
Presentation logic

Prez. Logic —>
Controllers

Biz. Logic —>
Services

•
•
•
•
•
•

how should I fetch data from the server?
how do I delete an email?
should I allow this action to take place?
how should data be cached?
should data be returned from my local
cache or the server?
is this data valid?

•
•
•
•

making the right service calls to fetch
data needed for the view
responding to user actions (such as
clicks, selections, etc.)
modifying the Model (through the
scope) to correctly display elements
putting the data in the right place for the
view to render itself
That’s all, folks!
Do you need Fundoo?
Starting out?
Starting out?

Hands-on AngularjS
Hands-on AngularjS
Workshops
Workshops

Need a team?
Need a team?

Development
Development
Consulting
Consulting

Stuck? Need
Stuck? Need
Advice?
Advice?

Expert Consulting
Expert Consulting
Questions?
@omniscient
1
shyam@befundoo.co
m

Weitere ähnliche Inhalte

Was ist angesagt?

There Are No “Buts” in Progressive Enhancement [Øredev 2015]
There Are No “Buts” in Progressive Enhancement [Øredev 2015]There Are No “Buts” in Progressive Enhancement [Øredev 2015]
There Are No “Buts” in Progressive Enhancement [Øredev 2015]Aaron Gustafson
 
Contextual jQuery
Contextual jQueryContextual jQuery
Contextual jQueryDoug Neiner
 
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)David Giard
 
Chrome DevTools Introduction 2020 Web Developers Guide
Chrome DevTools Introduction 2020 Web Developers GuideChrome DevTools Introduction 2020 Web Developers Guide
Chrome DevTools Introduction 2020 Web Developers GuideLaurence Svekis ✔
 
Presentational jQuery
Presentational jQueryPresentational jQuery
Presentational jQueryDoug Neiner
 
JavaServer Pages
JavaServer Pages JavaServer Pages
JavaServer Pages profbnk
 
FUSEe(β)で技術書プリティ化計画 公開版
FUSEe(β)で技術書プリティ化計画 公開版FUSEe(β)で技術書プリティ化計画 公開版
FUSEe(β)で技術書プリティ化計画 公開版Shunsuke Ito
 
2011 - SharePoint + jQuery
2011 - SharePoint + jQuery2011 - SharePoint + jQuery
2011 - SharePoint + jQueryChris O'Connor
 
Unobtrusive JavaScript
Unobtrusive JavaScriptUnobtrusive JavaScript
Unobtrusive JavaScriptVitaly Baum
 
J query presentation
J query presentationJ query presentation
J query presentationakanksha17
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 featuresGill Cleeren
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQueryAngel Ruiz
 

Was ist angesagt? (20)

Get and post,session and cookie
Get and post,session and cookieGet and post,session and cookie
Get and post,session and cookie
 
DirectToWeb 2.0
DirectToWeb 2.0DirectToWeb 2.0
DirectToWeb 2.0
 
Client Web
Client WebClient Web
Client Web
 
There Are No “Buts” in Progressive Enhancement [Øredev 2015]
There Are No “Buts” in Progressive Enhancement [Øredev 2015]There Are No “Buts” in Progressive Enhancement [Øredev 2015]
There Are No “Buts” in Progressive Enhancement [Øredev 2015]
 
Please dont touch-3.6-jsday
Please dont touch-3.6-jsdayPlease dont touch-3.6-jsday
Please dont touch-3.6-jsday
 
Contextual jQuery
Contextual jQueryContextual jQuery
Contextual jQuery
 
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)How I Learned to Stop Worrying and Love jQuery (Jan 2013)
How I Learned to Stop Worrying and Love jQuery (Jan 2013)
 
Chrome DevTools Introduction 2020 Web Developers Guide
Chrome DevTools Introduction 2020 Web Developers GuideChrome DevTools Introduction 2020 Web Developers Guide
Chrome DevTools Introduction 2020 Web Developers Guide
 
Web performance
Web performanceWeb performance
Web performance
 
Presentational jQuery
Presentational jQueryPresentational jQuery
Presentational jQuery
 
JavaServer Pages
JavaServer Pages JavaServer Pages
JavaServer Pages
 
FUSEe(β)で技術書プリティ化計画 公開版
FUSEe(β)で技術書プリティ化計画 公開版FUSEe(β)で技術書プリティ化計画 公開版
FUSEe(β)で技術書プリティ化計画 公開版
 
22 j query1
22 j query122 j query1
22 j query1
 
2011 - SharePoint + jQuery
2011 - SharePoint + jQuery2011 - SharePoint + jQuery
2011 - SharePoint + jQuery
 
Dynamic documentation - SRECON 2017
Dynamic documentation - SRECON 2017Dynamic documentation - SRECON 2017
Dynamic documentation - SRECON 2017
 
Unobtrusive JavaScript
Unobtrusive JavaScriptUnobtrusive JavaScript
Unobtrusive JavaScript
 
J query presentation
J query presentationJ query presentation
J query presentation
 
Top 10 HTML5 features
Top 10 HTML5 featuresTop 10 HTML5 features
Top 10 HTML5 features
 
Unobtrusive javascript with jQuery
Unobtrusive javascript with jQueryUnobtrusive javascript with jQuery
Unobtrusive javascript with jQuery
 
SEA Open Hack - YQL
SEA Open Hack - YQLSEA Open Hack - YQL
SEA Open Hack - YQL
 

Ähnlich wie Angular js How, What & Why - MetaRefresh 2014

jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesMark Roden
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuningJohn McCaffrey
 
Joker'15 Java straitjackets for MongoDB
Joker'15 Java straitjackets for MongoDBJoker'15 Java straitjackets for MongoDB
Joker'15 Java straitjackets for MongoDBAlexey Zinoviev
 
J query presentation
J query presentationJ query presentation
J query presentationsawarkar17
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to conceptsAbhishek Sur
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - IntroductionSagar Acharya
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to JqueryGurpreet singh
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownMark Rackley
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJSSrijan Technologies
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)Doris Chen
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationSean Burgess
 
Quick start with AngularJS
Quick start with AngularJSQuick start with AngularJS
Quick start with AngularJSIuliia Baranova
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery EssentialsMark Rackley
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day WorkshopShyam Seshadri
 
Overview on jQuery mobile
Overview on jQuery mobileOverview on jQuery mobile
Overview on jQuery mobileMd. Ziaul Haq
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizationsChris Love
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!Nicholas Zakas
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsclimboid
 
Laravel + Restangular Introduction
Laravel + Restangular IntroductionLaravel + Restangular Introduction
Laravel + Restangular IntroductionAndrew Del Prete
 

Ähnlich wie Angular js How, What & Why - MetaRefresh 2014 (20)

jQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPagesjQuery - the world's most popular java script library comes to XPages
jQuery - the world's most popular java script library comes to XPages
 
Cvcc performance tuning
Cvcc performance tuningCvcc performance tuning
Cvcc performance tuning
 
Joker'15 Java straitjackets for MongoDB
Joker'15 Java straitjackets for MongoDBJoker'15 Java straitjackets for MongoDB
Joker'15 Java straitjackets for MongoDB
 
J query presentation
J query presentationJ query presentation
J query presentation
 
Angular JS, A dive to concepts
Angular JS, A dive to conceptsAngular JS, A dive to concepts
Angular JS, A dive to concepts
 
Angular JS - Introduction
Angular JS - IntroductionAngular JS - Introduction
Angular JS - Introduction
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
SPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have knownSPSDenver - SharePoint & jQuery - What I wish I would have known
SPSDenver - SharePoint & jQuery - What I wish I would have known
 
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
[Srijan Wednesday Webinars] Developing Large Scale Applications in AngularJS
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
Quick start with AngularJS
Quick start with AngularJSQuick start with AngularJS
Quick start with AngularJS
 
SharePoint and jQuery Essentials
SharePoint and jQuery EssentialsSharePoint and jQuery Essentials
SharePoint and jQuery Essentials
 
AngularJS One Day Workshop
AngularJS One Day WorkshopAngularJS One Day Workshop
AngularJS One Day Workshop
 
Overview on jQuery mobile
Overview on jQuery mobileOverview on jQuery mobile
Overview on jQuery mobile
 
Alloy backbone
Alloy backboneAlloy backbone
Alloy backbone
 
JavaScript front end performance optimizations
JavaScript front end performance optimizationsJavaScript front end performance optimizations
JavaScript front end performance optimizations
 
Enough with the JavaScript already!
Enough with the JavaScript already!Enough with the JavaScript already!
Enough with the JavaScript already!
 
Yeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web appsYeoman AngularJS and D3 - A solid stack for web apps
Yeoman AngularJS and D3 - A solid stack for web apps
 
Laravel + Restangular Introduction
Laravel + Restangular IntroductionLaravel + Restangular Introduction
Laravel + Restangular Introduction
 

Kürzlich hochgeladen

Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
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
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
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
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Nikki Chapple
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observabilityitnewsafrica
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 

Kürzlich hochgeladen (20)

Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
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
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
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.
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
Microsoft 365 Copilot: How to boost your productivity with AI – Part one: Ado...
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
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
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security ObservabilityGlenn Lazarus- Why Your Observability Strategy Needs Security Observability
Glenn Lazarus- Why Your Observability Strategy Needs Security Observability
 
React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 

Angular js How, What & Why - MetaRefresh 2014

  • 1. AngularJS: How, Why & What’s the difference? Shyam Seshadri Director, Fundoo Solutions
  • 2. “Who are you again??” –Most people I meet
  • 3. I am • Xoogler - Feedback & AngularJS team • MBA, ISB Hyderabad • Author, AngularJS, O’Reilly • Director, Fundoo Solutions • Part time AngularJS Trainer • Coder / Geek
  • 4. History • Started when JS was sexy, but hard to manage • Google Feedback, in GWT Hell • Every framework / language had some good things • Flex with Data binding (one-way, though) • Ruby routes • Java with Dependency Injection & Testability
  • 5. “Hey, I built a framework to learn Javascript in my free time. We should totally use it.” –Misko Hevery, Founder of AngularJS
  • 6. So what is Open Source, Open Source, Javascript Javascript Extension Extension friendly friendly Declarative, Declarative, MVVW MVVW Extends Extends HTML HTML Great Great Community Community To Create To Create Amazing Web Amazing Web Apps Apps
  • 7. The promised land? THE PROMISE THE RESULT REDUCED LINES OF CODE From 20,000 to 1500!! FASTER DEVELOPMENT 6 months, GWT = 3 weeks, AngularJS
Increased Velocity!! TESTABLE, MAINTAINABLE JS Dependency Injection & S
uper Fast Unit Testing EASIER TEMPLATING & STYLING Templates pure HTML, CS
S
 & Designer friendly INTEGRATE WITH OTHER LIBRARIES Directives! Extend HTML and teach it new tricks!
  • 8.
  • 9. Advantages - Developer HTML + JS HTML + JS Data Binding Data Binding Dependency Injection Dependency Injection Custom Components Custom Components Super Easy Testing Super Easy Testing Amazing Community! Amazing Community!
  • 10. The Result? Drastically Less Lines Drastically Less Lines of Code of Code Focus on your core, Focus on your core, not the crap not the crap More maintainable, More maintainable, extensible extensible Component friendly Component friendly Well Tested, Robust Well Tested, Robust Designer Friendly Designer Friendly
  • 11. Requirements? • The same requirements that jQuery has • A Server!! (Sometimes…) • Works well with Java, as well as with Ruby, Python, etc. • • • Really independent of the Server Needs a way of fetching and storing Data (XHR, Sockets…) Easier if it talks JSON But not required • Can transform requests and responses • No JSON? No problem! •
  • 12. Starting an AngularJS Project <html ng-app> <head> <script src=“angular.min.js”></script> </head> <body> <input type=“text” ng-model=“name”> <h1>Hello {{name}}</h1> </body> </html>
  • 13. Who’s using AngularJS? • • • • • • • • Google (of course!) Double Click for Advertisers Youtube And many more Amazon Netflix Banks Lots of startups
  • 14. Future Plans • A Revamped Change Detection Algorithm • Web Components Interop • A Better Data Persistence story • Awesomer Dependency Injection • Nicer Logging • And a whole lot more
  • 15. What have I worked with AngularJS on? Prototyping Prototyping EPG Application EPG Application Mail Application Mail Application Wedding & Photography Wedding & Photography E-Commerce, Analytics E-Commerce, Analytics & more & more
  • 16. Thinking the AngularJS way! or how to get the most out of AngularJS or how to get the most out of AngularJS
  • 17. “There are many steps to AngularJS Nirvana. Here are some to make sure you get there!” –Me!!
  • 18. 1. Model is the Truth! Model comes from the server Model comes from the server Controller manipulates it Controller manipulates it View displays it View displays it Need to update the view? Need to update the view? Update the Update the model!! model!!
  • 19. Tabs in jQuery <ul class="tabs"> <li class="tab1 selected">Tab 1</li> <li class="tab2">Tab 2</li> </ul> <div class="tab1">Content for Tab 1</div> <div class="tab2">Content for Tab 2</div> Plus •Tab highlighting logic •Tab content logic •Not declarative!!
  • 20. Tabs leveraging Data binding <ul class="tabs”> <li class="tab1" ng-class="{selected: isSelected(‘tab1’)}”>Tab 1</li> <li class="tab2" ng-class="{selected: isSelected(‘tab2')}">Tab 2</li> </ul> <div class="tab1" ng-show="isSelected('tab1')">Content Tab 1</div> <div class="tab2" ng-show="isSelected('tab2')">Content Tab 2</div> $scope.isSelected = function(tab) { return tab === currentTab; };
  • 21. Tabs in AngularJS Or even better, do this: <tabs> <tab title=“My First Tab”>Tab 1 content here</tab> <tab title=“My Second Tab”>Tab 2 content here</tab> </tabs>
  • 22. 2. Leverage Data-binding Why do this? <form id="my-form”> <input type="text" id="nameField”> <input type="email" id="emailField”> <button>Submit</button> </form> function setFormValues(userDetails) { $('#nameField').value(userDetails.name); $('#emailField').value(userDetails.email); } // GETTING ALSO… When you can do this? <form id="my-form”> <input type="text" id="nameField” ng-model="user.name”> <input type="email" id="emailField” ng-model="user.email”> <button>Submit</button> </form> $scope.user
  • 23. 3. DOM Manipulation —> Directives Don’t do this in your controller $('#inputDate').datepicker(); $('#inputDate') .datepicker('getDate'); $('#inputDate') .datepicker('setDate’, '05/23/1975'); Instead, create a directive <input type="text” jqui-datepicker ng-model="startDate” date-format= "DD/mm/YYYY” on-select= ”dateSelected(date)”>
  • 24. Lack of Lack of compiler compiler Prevent Prevent Regressions Regressions “4.) Test Early, Test Often, and Keep testing” Reduce manual Reduce manual labor, increase labor, increase turnaround turnaround –Some Wise Guru Specification for Specification for the code the code
  • 25. 5.) Separate Biz. Logic vs Presentation logic Prez. Logic —> Controllers Biz. Logic —> Services • • • • • • how should I fetch data from the server? how do I delete an email? should I allow this action to take place? how should data be cached? should data be returned from my local cache or the server? is this data valid? • • • • making the right service calls to fetch data needed for the view responding to user actions (such as clicks, selections, etc.) modifying the Model (through the scope) to correctly display elements putting the data in the right place for the view to render itself
  • 27. Do you need Fundoo? Starting out? Starting out? Hands-on AngularjS Hands-on AngularjS Workshops Workshops Need a team? Need a team? Development Development Consulting Consulting Stuck? Need Stuck? Need Advice? Advice? Expert Consulting Expert Consulting

Hinweis der Redaktion

  1. JS Stack AngularJS enthusiast
  2. the Java promise How do you get a gmail like app, without so much code and making it maintainable
  3. The entire aim of an AngularJS app is to modify the model. The UI updates automatically