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

PDF
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
PDF
Why Redux-Observable?
PPTX
Aspdevice - Asp Fast Crud introdution
PDF
KCDC 2018 - Rapid API Development with Sails
PDF
1991 clasificatoria
PPTX
J Query - Your First Steps
KEY
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript'...
DOCX
Algoritma 5 november wiwik p.l
Танки_в_Лунапарке: нагрузочное_тестирование_в_Яндексе
Why Redux-Observable?
Aspdevice - Asp Fast Crud introdution
KCDC 2018 - Rapid API Development with Sails
1991 clasificatoria
J Query - Your First Steps
The Return of JavaScript: 3 Open-Source Projects that are driving JavaScript'...
Algoritma 5 november wiwik p.l

What's hot (20)

PDF
Universal JavaScript
PDF
Ellzey 5611 module 3
PDF
Go Mobile with Apache Cordova, Zagreb 2014
TXT
fabfile.py
PDF
Web APIs you (probably) didn't know existed
PDF
Postman On Steroids
PDF
World of Logging
PDF
One page app with AngularJS
PDF
Asynchronous Programming FTW! 2 (with AnyEvent)
PDF
Wso2 esb-rest-integration
PDF
제5회인터넷리더십프로그램_왕초보를 위한 트위터 완벽 활용_정진호
KEY
10 Catalyst Tips
PDF
Any event intro
RTF
Document
PDF
Make WordPress realtime.
KEY
Zen: Building Maintainable Catalyst Applications
PDF
レッツゴーデベロッパー2011「プログラミングGroovy〜G*エコシステム編」
PDF
Islam House
PDF
PPT
You promise?
Universal JavaScript
Ellzey 5611 module 3
Go Mobile with Apache Cordova, Zagreb 2014
fabfile.py
Web APIs you (probably) didn't know existed
Postman On Steroids
World of Logging
One page app with AngularJS
Asynchronous Programming FTW! 2 (with AnyEvent)
Wso2 esb-rest-integration
제5회인터넷리더십프로그램_왕초보를 위한 트위터 완벽 활용_정진호
10 Catalyst Tips
Any event intro
Document
Make WordPress realtime.
Zen: Building Maintainable Catalyst Applications
レッツゴーデベロッパー2011「プログラミングGroovy〜G*エコシステム編」
Islam House
You promise?
Ad

Viewers also liked (15)

PDF
Presentation sanlab workshops
PDF
JWEF Singapore - Building a company for fun, by Keith Ng, Gametize
PPT
PPT
Our teaser trailer idea final
PPTX
Trailer analysis toy story 3
PPT
Our teaser trailer idea final
PDF
Team Building Company Brochure 2011
PDF
Event management software market teaser
PPSX
Corporate events presentation
PPTX
Corporate events ppt
PDF
Events Marketing
PDF
Gapingvoid: How To Supercharge Your Event
PPT
Content Marketing for Events
KEY
Event planning powerpoint
PPTX
Presentation sanlab workshops
JWEF Singapore - Building a company for fun, by Keith Ng, Gametize
Our teaser trailer idea final
Trailer analysis toy story 3
Our teaser trailer idea final
Team Building Company Brochure 2011
Event management software market teaser
Corporate events presentation
Corporate events ppt
Events Marketing
Gapingvoid: How To Supercharge Your Event
Content Marketing for Events
Event planning powerpoint
Ad

Similar to Introduction to AngularJS (20)

PDF
Building modern web apps with html5, javascript, and java
PDF
Building a JavaScript Library
PDF
AngularJS Beginner Day One
PPTX
Introducing AngularJS
KEY
An in-depth look at jQuery
PPTX
OCTO BOF - How to build Netvibes with AngularJS
PDF
Zepto and the rise of the JavaScript Micro-Frameworks
PDF
Angular js gtg-27feb2013
PDF
mobl presentation @ IHomer
KEY
Spiffy Applications With JavaScript
PPTX
Introduction to Knockoutjs
PPTX
AngularJS One Day Workshop
KEY
User Interface Development with jQuery
PDF
Quick start with AngularJS
PDF
AngularJS in Production (CTO Forum)
PDF
Huge web apps web expo 2013
KEY
JavaScript Neednt Hurt - JavaBin talk
PDF
Itroducing Angular JS
PDF
JavaScript for Flex Devs
PDF
Introduction To Angular.js - SpringPeople
Building modern web apps with html5, javascript, and java
Building a JavaScript Library
AngularJS Beginner Day One
Introducing AngularJS
An in-depth look at jQuery
OCTO BOF - How to build Netvibes with AngularJS
Zepto and the rise of the JavaScript Micro-Frameworks
Angular js gtg-27feb2013
mobl presentation @ IHomer
Spiffy Applications With JavaScript
Introduction to Knockoutjs
AngularJS One Day Workshop
User Interface Development with jQuery
Quick start with AngularJS
AngularJS in Production (CTO Forum)
Huge web apps web expo 2013
JavaScript Neednt Hurt - JavaBin talk
Itroducing Angular JS
JavaScript for Flex Devs
Introduction To Angular.js - SpringPeople

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.