google developers group - porto alegre # introducing to angularjs

22
HTML enhanced for web apps Google Developers Group - Porto Alegre 11-26-2013

Upload: vinny-linck

Post on 12-May-2015

991 views

Category:

Technology


0 download

DESCRIPTION

A brief presentation about AngularJS performed during Google Developers Group meeting in Porto Alegre/Brazil on november 26th.

TRANSCRIPT

Page 1: Google Developers Group - Porto Alegre # Introducing to AngularJS

HTML enhanced for web appsGoogle Developers Group - Porto Alegre

11-26-2013

Page 2: Google Developers Group - Porto Alegre # Introducing to AngularJS

Vinicius LinckMobile Apps Architect

Page 3: Google Developers Group - Porto Alegre # Introducing to AngularJS

var agenda ={

“chapter1”: “Angular… what?”,

“chapter2”: “How does it work?”,

“chapter3”: “Why Angular?”,

“chapter4”: “Common pitfalls”,

“chapter 5”: “Things I wish I were told about being hero…”

};

Page 4: Google Developers Group - Porto Alegre # Introducing to AngularJS

AngularJSA super-heroic Javascript framework

Page 5: Google Developers Group - Porto Alegre # Introducing to AngularJS

Facing the truth:Java is to javascript as ham is to hamster…

Page 6: Google Developers Group - Porto Alegre # Introducing to AngularJS

Little bits of history

• Created 2009 by Misko Hervery (Googler) and Adam Abron;

• GetAngular.com: Front end for an online JSON storage service;

• New members: Igor Minár & Vojta Jína (Googlers)

Page 7: Google Developers Group - Porto Alegre # Introducing to AngularJS

Background

• HTML is an excellent choice for declaring static documents, but it falters when providing dynamic behaviour, which is important for web apps.

• AngularJS extends HTML vocabulary of your application resulting in an expressive, readable and productive develop environment.

Page 8: Google Developers Group - Porto Alegre # Introducing to AngularJS

AngularJS• An open-source javascript framework maintained

by Google;

• MVW (Model-View-Whatever);

• Declarative programming for UIs (HTML, CSS);

• Imperative programming for expressing BL (javascript);

• Designed for Decoupling & Testing;

Page 9: Google Developers Group - Porto Alegre # Introducing to AngularJS

How does it work?Web programming requires web understanding

Page 10: Google Developers Group - Porto Alegre # Introducing to AngularJS

Common applicationYou need to implement the “cycle”

Page 11: Google Developers Group - Porto Alegre # Introducing to AngularJS

This is the “cycle”You need to respect that… and learn how to break it.

STEAL THIS SLIDE

Page 12: Google Developers Group - Porto Alegre # Introducing to AngularJS

Scope is the keyUnderstanding scopes, you understand pretty much

everything…

STEAL THIS SLIDE

Page 13: Google Developers Group - Porto Alegre # Introducing to AngularJS

Things got easier…… and now, you are ready for single-page application

development.

Page 14: Google Developers Group - Porto Alegre # Introducing to AngularJS
Page 15: Google Developers Group - Porto Alegre # Introducing to AngularJS

Why angular?• Two-way data bindings: one source of information;

• Directives: extend your app as you wish;

• Dependency injection;

• Less coding (~50%): fewer bugs;

• Awesome performance;

• Is JQuery compatible (try to avoid that);

• Reusability!!!!

Page 16: Google Developers Group - Porto Alegre # Introducing to AngularJS

Common pitfalls…… and how to deal with them.

Page 17: Google Developers Group - Porto Alegre # Introducing to AngularJS

Ugly, but tasteful…• JQM Stack

• MEAN Stack

• yo-yo problem

• Sequential coupling

• Poltergeists

• Action at a distance

• Lasagna code

STEAL THIS SLIDE

Page 18: Google Developers Group - Porto Alegre # Introducing to AngularJS

Starting with AngularJSThings I wish I were told about being hero…

Page 19: Google Developers Group - Porto Alegre # Introducing to AngularJS
Page 20: Google Developers Group - Porto Alegre # Introducing to AngularJS

Be aware…• How modules work;

• scope and rootscope differences;

• Always manipulate DOM through directives;

• Keep “event orgy” under control;

• Try to understand how things are implemented before import an existing module into your app;

• Study browser internals!

STEAL THIS SLIDE

Page 21: Google Developers Group - Porto Alegre # Introducing to AngularJS

Refactor & RewriteThere’s no framework capable to replace dumbness…

Page 22: Google Developers Group - Porto Alegre # Introducing to AngularJS

[email protected] http://vinnylinck.tumblr.com

$scope.$emit(“THANK YOU!”);