SlideShare a Scribd company logo
AngularJS
HTML ENHANCED FOR WEB APPS
   -   Patrick Aljord / @patcito
What Is AngularJS Trying To Fix?
HTML is great for declarative code for static web page
<>el wrd<p
pHlo ol!/>


              Not so for dynamic pages:
< i=getn1>/>
 p d"reig"<p
 <cit
  srp>
   vriI =dcmn.tahvn;
   a sE    ouetatcEet
   vraditnr=iI
   a dLsee    sE
    ?fnto(,t f){
       ucine , n
       eatcEet'n +t f)}
        .tahvn(o'  , n;
    :fnto(,t f){
       ucine , n
       eadvnLsee(,f,fle;;
        .dEetitnrt n as)}
   aditnrdcmn,'od,fnto({
   dLsee(ouet la' ucin)
    vrgetn =dcmn.eEeetyd'reig';
     a reig   ouetgtlmnBI(getn1)
    i (sE {
     f iI)
      getn.neTx ='el Wrd'
       reiginret  Hlo ol!;
    }es {
       le
      getn.etotn ='el Wrd'
       reigtxCnet  Hlo ol!;
    }
   };
   )
 <srp>
  /cit
But...

                 = Imperative :-(

     Declarative FTW!
1.    <>el wrd/>
       pHlo ol<p



2.    <>{reig}/>
       p{Getn}<p
Data Binding
1.   Define a model
2.   Binds it to a template
3.   When you modify the model, templates updates automotically
4.   When the user intereacts with the UI, templates knows how
     to sync the data with the model.
Concrete Example: JQuery Vs AngularJS
<cittp=tx/aacit>
srp ye"etjvsrp"
 $fnto ( {
 (ucin )
  vrnm =$'nm'.a(;
  a ae   (#ae)vl)
  vrgetn =$'getn';
  a reig   (#reig)

    nm.eu(ucin( {
     aekypfnto )
      getn.et'el ' nm +'';
       reigtx(Hlo + ae !)
    })
  })
<srp>
 /cit
<i>
 dv
<ae>ae<lbl
 lblNm:/ae>
<nu tp=tx"i=nm"
 ipt ye"et d"ae>
< i=getn"<p
 p d"reig>/>
<dv
 /i>



               Name:   Enter a name here




                    HELLO
Concrete Example: JQuery Vs AngularJS
 <i n-p>
  dv gap
 <ae>ae<lbl
  lblNm:/ae>
 <nu tp=tx"n-oe=yuNm"
  ipt ye"et gmdl"orae>
 <>el {yuNm}!/>
  pHlo {orae}<p
 <dv
  /i>



           Name:   Enter a name here




             HELLO !
SO DATA BINDING ALLOWS CODE THAT IS
   1. very simple
   2. very recognizable
   3. looks like the original HTML hello world
                   Thanks To...
    1.   Dirty checking
    2.   Only checks the current view
    3.   Only check when change may happen
    4.   Leverage the JIT
    5.   But... the DOM is slow
DATA BINDING COMING TO A BROWSER NEAR
                  YOU
                      Implementation When?
AngularJS             Javascript      Now
Model Driven Views Native             Future
Object.observe        Native          Future
  There's already an AngularJS branch using Object.observe !
BUT HTML CAN BE
   VERBOSE!
↤ Beatiful widgets: Cool
      Tricking the browser: Not Cool ↧↧
  <lcas"a nvtb"i=mTb>
   u ls=nv a-as d"ya"
    <icas"cie>ahe=#eto1>eto 1/>/i
     l ls=atv"< rf"scin"Scin <a<l>
    <i< he=#rfl"Scin2/>/i
     l>a rf"poie>eto <a<l>
  <u>
   /l

  <i cas"a-otn"
   dv ls=tbcnet>
    <i cas"a-aeatv"i=scin"H,ImScin1/i
     dv ls=tbpn cie d"eto1>i ' eto <d
  v>
    <i cas"a-ae i=scin"H,ImScin2/i>
     dv ls=tbpn" d"eto2>i ' eto <dv
  <dv
   /i>

  <cit
   srp>
   $fnto ( {
    (ucin )
     $'mTbals'.a(so';
      (#ya :at)tb'hw)
   })
  <srp>
   /cit



Declarative reusable components:
             Cool ↧↧
 <as
 tb>
  <aette"eto 1>
   pn il=Scin "
   H,ImScin1
    i ' eto
  <pn>
   /ae
  <aette"eto 2>
   pn il=Scin "
   H,ImScin2
    i ' eto
  <pn>
   /ae
 <tb>
 /as
<google-map>
           <tabs>
          <tweet>
          <avatar>
        <color-picker>
          <invoice>

<unleash-your-imagination>
REUSABLE COMPONENTS COMING TO A
            BROWSER NEAR YOU
             Implementation When?
AngularJS    DOM+JS         Now
             (directives)
Web          Native         Near Future
Components
Mozilla shim for web components: x-tags.org
W3C specs:
http://www.w3.org/TR/2012/WD-components-intro-
20120522/#custom-element-section
THE WHOLE PACKAGE
       TO BUILD KICK ASS WEB APPS!
  ✓ Data binding
  ✓ Templating
  ✓ Routing and deep linking
  ✓ Testing
  ✓ Form validation
  ✓ Dependency injection
  ✓ MVW (Model/View/Whatever!)
Introduction to AngularJS
angularjs scaffold
Checkout angularjs_scaffold if you're into Rails.
https://github.com/patcito/angularjs_scaffold
Thanks!
                   Patrick Aljord @patcito
                 http://blog.ricodigo.com
                 http://twitter.com/patcito
                 +Patrick Aljord




Credits for the slides: Vojta Jína, Miško Hevery, Igor Minar.
Introduction to AngularJS

More Related Content

What's hot (20)

PDF
Universal JavaScript
名辰 洪
 
PDF
Ellzey 5611 module 3
cellzey
 
PDF
Go Mobile with Apache Cordova, Zagreb 2014
Christian Grobmeier
 
TXT
fabfile.py
Corey Oordt
 
PDF
Web APIs you (probably) didn't know existed
Zeno Rocha
 
PDF
Postman On Steroids
Sara Tornincasa
 
PDF
World of Logging
Christian Grobmeier
 
PDF
One page app with AngularJS
Adam Štipák
 
PDF
Asynchronous Programming FTW! 2 (with AnyEvent)
xSawyer
 
PDF
Wso2 esb-rest-integration
Chanaka Fernando
 
PDF
제5회인터넷리더십프로그램_왕초보를 위한 트위터 완벽 활용_정진호
daumfoundation
 
KEY
10 Catalyst Tips
Jay Shirley
 
PDF
Any event intro
qiang
 
RTF
Document
viwviw
 
PDF
Make WordPress realtime.
Josh Hillier
 
KEY
Zen: Building Maintainable Catalyst Applications
Jay Shirley
 
PDF
レッツゴーデベロッパー2011「プログラミングGroovy〜G*エコシステム編」
Yasuharu Nakano
 
PDF
Islam House
Haris Padinharethil
 
PDF
jQuery
Andrew Homeyer
 
PPT
You promise?
IT Weekend
 
Universal JavaScript
名辰 洪
 
Ellzey 5611 module 3
cellzey
 
Go Mobile with Apache Cordova, Zagreb 2014
Christian Grobmeier
 
fabfile.py
Corey Oordt
 
Web APIs you (probably) didn't know existed
Zeno Rocha
 
Postman On Steroids
Sara Tornincasa
 
World of Logging
Christian Grobmeier
 
One page app with AngularJS
Adam Štipák
 
Asynchronous Programming FTW! 2 (with AnyEvent)
xSawyer
 
Wso2 esb-rest-integration
Chanaka Fernando
 
제5회인터넷리더십프로그램_왕초보를 위한 트위터 완벽 활용_정진호
daumfoundation
 
10 Catalyst Tips
Jay Shirley
 
Any event intro
qiang
 
Document
viwviw
 
Make WordPress realtime.
Josh Hillier
 
Zen: Building Maintainable Catalyst Applications
Jay Shirley
 
レッツゴーデベロッパー2011「プログラミングGroovy〜G*エコシステム編」
Yasuharu Nakano
 
Islam House
Haris Padinharethil
 
You promise?
IT Weekend
 

Viewers also liked (15)

PDF
Presentation sanlab workshops
Artur Roszczyk
 
PDF
JWEF Singapore - Building a company for fun, by Keith Ng, Gametize
Keith Ng (@keizng)
 
PPT
Fun day
serkan yesilbağ
 
PPT
Our teaser trailer idea final
amylewissimon1
 
PPTX
Trailer analysis toy story 3
Fordyy
 
PPT
Our teaser trailer idea final
amylewissimon1
 
PDF
Team Building Company Brochure 2011
The Team Building Company
 
PDF
Event management software market teaser
sukiennong.vn
 
PPSX
Corporate events presentation
globedu
 
PPTX
Corporate events ppt
TheBSIIndia
 
PDF
Events Marketing
Nj Lopez-Tan
 
PDF
Gapingvoid: How To Supercharge Your Event
Gapingvoid Culture Design Group
 
PPT
Content Marketing for Events
Joe Pulizzi
 
KEY
Event planning powerpoint
katelandturner
 
PPTX
Fun Is Good Ppt
university of indianapolis
 
Presentation sanlab workshops
Artur Roszczyk
 
JWEF Singapore - Building a company for fun, by Keith Ng, Gametize
Keith Ng (@keizng)
 
Our teaser trailer idea final
amylewissimon1
 
Trailer analysis toy story 3
Fordyy
 
Our teaser trailer idea final
amylewissimon1
 
Team Building Company Brochure 2011
The Team Building Company
 
Event management software market teaser
sukiennong.vn
 
Corporate events presentation
globedu
 
Corporate events ppt
TheBSIIndia
 
Events Marketing
Nj Lopez-Tan
 
Gapingvoid: How To Supercharge Your Event
Gapingvoid Culture Design Group
 
Content Marketing for Events
Joe Pulizzi
 
Event planning powerpoint
katelandturner
 
Ad

Similar to Introduction to AngularJS (20)

PDF
Building modern web apps with html5, javascript, and java
Alexander Gyoshev
 
PDF
Building a JavaScript Library
jeresig
 
PDF
AngularJS Beginner Day One
Troy Miles
 
PPTX
Introducing AngularJS
Loc Nguyen
 
KEY
An in-depth look at jQuery
Paul Bakaus
 
PPTX
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
PDF
Zepto and the rise of the JavaScript Micro-Frameworks
Thomas Fuchs
 
PDF
Angular js gtg-27feb2013
Nitya Narasimhan
 
PDF
mobl presentation @ IHomer
zefhemel
 
KEY
Spiffy Applications With JavaScript
Mark Casias
 
PPTX
Introduction to Knockoutjs
jhoguet
 
PPTX
AngularJS One Day Workshop
Shyam Seshadri
 
KEY
User Interface Development with jQuery
colinbdclark
 
PDF
Quick start with AngularJS
Iuliia Baranova
 
PDF
AngularJS in Production (CTO Forum)
Alex Ross
 
PDF
Huge web apps web expo 2013
Daniel Steigerwald
 
KEY
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
PDF
Itroducing Angular JS
Carlos Emanuel Mathiasen
 
PDF
JavaScript for Flex Devs
Aaronius
 
PDF
Introduction To Angular.js - SpringPeople
SpringPeople
 
Building modern web apps with html5, javascript, and java
Alexander Gyoshev
 
Building a JavaScript Library
jeresig
 
AngularJS Beginner Day One
Troy Miles
 
Introducing AngularJS
Loc Nguyen
 
An in-depth look at jQuery
Paul Bakaus
 
OCTO BOF - How to build Netvibes with AngularJS
Jonathan Meiss
 
Zepto and the rise of the JavaScript Micro-Frameworks
Thomas Fuchs
 
Angular js gtg-27feb2013
Nitya Narasimhan
 
mobl presentation @ IHomer
zefhemel
 
Spiffy Applications With JavaScript
Mark Casias
 
Introduction to Knockoutjs
jhoguet
 
AngularJS One Day Workshop
Shyam Seshadri
 
User Interface Development with jQuery
colinbdclark
 
Quick start with AngularJS
Iuliia Baranova
 
AngularJS in Production (CTO Forum)
Alex Ross
 
Huge web apps web expo 2013
Daniel Steigerwald
 
JavaScript Neednt Hurt - JavaBin talk
Thomas Kjeldahl Nilsson
 
Itroducing Angular JS
Carlos Emanuel Mathiasen
 
JavaScript for Flex Devs
Aaronius
 
Introduction To Angular.js - SpringPeople
SpringPeople
 
Ad

Introduction to AngularJS

  • 1. AngularJS HTML ENHANCED FOR WEB APPS - Patrick Aljord / @patcito
  • 2. What Is AngularJS Trying To Fix? HTML is great for declarative code for static web page <>el wrd<p pHlo ol!/> Not so for dynamic pages: < i=getn1>/> p d"reig"<p <cit srp> vriI =dcmn.tahvn; a sE ouetatcEet vraditnr=iI a dLsee sE ?fnto(,t f){ ucine , n eatcEet'n +t f)} .tahvn(o' , n; :fnto(,t f){ ucine , n eadvnLsee(,f,fle;; .dEetitnrt n as)} aditnrdcmn,'od,fnto({ dLsee(ouet la' ucin) vrgetn =dcmn.eEeetyd'reig'; a reig ouetgtlmnBI(getn1) i (sE { f iI) getn.neTx ='el Wrd' reiginret Hlo ol!; }es { le getn.etotn ='el Wrd' reigtxCnet Hlo ol!; } }; ) <srp> /cit
  • 3. But... = Imperative :-( Declarative FTW! 1. <>el wrd/> pHlo ol<p 2. <>{reig}/> p{Getn}<p
  • 4. Data Binding 1. Define a model 2. Binds it to a template 3. When you modify the model, templates updates automotically 4. When the user intereacts with the UI, templates knows how to sync the data with the model.
  • 5. Concrete Example: JQuery Vs AngularJS <cittp=tx/aacit> srp ye"etjvsrp" $fnto ( { (ucin ) vrnm =$'nm'.a(; a ae (#ae)vl) vrgetn =$'getn'; a reig (#reig) nm.eu(ucin( { aekypfnto ) getn.et'el ' nm +''; reigtx(Hlo + ae !) }) }) <srp> /cit <i> dv <ae>ae<lbl lblNm:/ae> <nu tp=tx"i=nm" ipt ye"et d"ae> < i=getn"<p p d"reig>/> <dv /i> Name: Enter a name here HELLO
  • 6. Concrete Example: JQuery Vs AngularJS <i n-p> dv gap <ae>ae<lbl lblNm:/ae> <nu tp=tx"n-oe=yuNm" ipt ye"et gmdl"orae> <>el {yuNm}!/> pHlo {orae}<p <dv /i> Name: Enter a name here HELLO !
  • 7. SO DATA BINDING ALLOWS CODE THAT IS 1. very simple 2. very recognizable 3. looks like the original HTML hello world Thanks To... 1. Dirty checking 2. Only checks the current view 3. Only check when change may happen 4. Leverage the JIT 5. But... the DOM is slow
  • 8. DATA BINDING COMING TO A BROWSER NEAR YOU Implementation When? AngularJS Javascript Now Model Driven Views Native Future Object.observe Native Future There's already an AngularJS branch using Object.observe !
  • 9. BUT HTML CAN BE VERBOSE!
  • 10. ↤ Beatiful widgets: Cool Tricking the browser: Not Cool ↧↧ <lcas"a nvtb"i=mTb> u ls=nv a-as d"ya" <icas"cie>ahe=#eto1>eto 1/>/i l ls=atv"< rf"scin"Scin <a<l> <i< he=#rfl"Scin2/>/i l>a rf"poie>eto <a<l> <u> /l <i cas"a-otn" dv ls=tbcnet> <i cas"a-aeatv"i=scin"H,ImScin1/i dv ls=tbpn cie d"eto1>i ' eto <d v> <i cas"a-ae i=scin"H,ImScin2/i> dv ls=tbpn" d"eto2>i ' eto <dv <dv /i> <cit srp> $fnto ( { (ucin ) $'mTbals'.a(so'; (#ya :at)tb'hw) }) <srp> /cit Declarative reusable components: Cool ↧↧ <as tb> <aette"eto 1> pn il=Scin " H,ImScin1 i ' eto <pn> /ae <aette"eto 2> pn il=Scin " H,ImScin2 i ' eto <pn> /ae <tb> /as
  • 11. <google-map> <tabs> <tweet> <avatar> <color-picker> <invoice> <unleash-your-imagination>
  • 12. REUSABLE COMPONENTS COMING TO A BROWSER NEAR YOU Implementation When? AngularJS DOM+JS Now (directives) Web Native Near Future Components
  • 13. Mozilla shim for web components: x-tags.org W3C specs: http://www.w3.org/TR/2012/WD-components-intro- 20120522/#custom-element-section
  • 14. THE WHOLE PACKAGE TO BUILD KICK ASS WEB APPS! ✓ Data binding ✓ Templating ✓ Routing and deep linking ✓ Testing ✓ Form validation ✓ Dependency injection ✓ MVW (Model/View/Whatever!)
  • 16. angularjs scaffold Checkout angularjs_scaffold if you're into Rails. https://github.com/patcito/angularjs_scaffold
  • 17. Thanks! Patrick Aljord @patcito http://blog.ricodigo.com http://twitter.com/patcito +Patrick Aljord Credits for the slides: Vojta Jína, Miško Hevery, Igor Minar.