"Teaching browsers new tricks" Introduction to AngularJs Directives By : Imal hasaranga
“Conventional web development will start dying dramatically in coming years” By : Imal hasaranga
What is Conventional Web Dev... <!DOCTYPE html> <html> <head>...</head> <body> <form method="POST" action="/userlogin" > <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit" value="login" /> </form> </body> </html> /userlogin Server Controller DB View Model <!DOCTYPE html> <html> <head>...</head> <body> <h1>Welcome : Imal</h1> </body> </html> <!DOCTYPE html> <html> <head>...</head> <body> <h1>Welcome : <%=username %></h1> </body> </html>
Response Time User Bandwidth Response Content Server speed
Does Loading time matters ? • A survey revealed that loading time is major contributing factor to page abandonment • Page load time is greater than 3 seconds, 20% of visitors will abandon the page • Wallmart found that every 100ms reduction in loading time leads to an increase in incremental revenue by as much a 1%
SPA <!DOCTYPE html> <html> <head> <link rel="stylesheet" type="text/css" href="main.css"> </head> <body> <div class="content"> <!--- Dynamically filling ---> </div> </body> <script src="bower/angular/angular.js"></script> <script src="bower/angular-route/angular-route.js"></script> <script src="js/app.js"></script> <script src="js/services.js"></script> <script src="js/controllers.js"></script> </html> <form method="POST" action="/userlogin" > <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit" value="login" /> </form> <h1>Welcome : {{username}}</h1> /login /loginSuccess <div>Another HTML Content</div> /anotherUrl
Benefits of SPA • Client Side Routing. • Client Side Rendering. • More responsive than normal web apps. • Because Most of the things happen in client side server load reduces. • SPA forces developers to create REST api so UI become just another client. • Perfect for supporting multiple platforms. Clients is more fatter and intelligent than before
Why AngularJS ?
Why AngularJS ? • AngularJs built specifically focusing SPA Development. • Provide Client side MVC architecture. • Custom elements with directives. • Allows us to write less and manageable code. • Flexibility with filters. • Forces developers to do right things at right places. • Unit testing ready.
Can you show us something working please?

Why AngularJs

  • 1.
    "Teaching browsers newtricks" Introduction to AngularJs Directives By : Imal hasaranga
  • 2.
    “Conventional web development willstart dying dramatically in coming years” By : Imal hasaranga
  • 3.
    What is ConventionalWeb Dev... <!DOCTYPE html> <html> <head>...</head> <body> <form method="POST" action="/userlogin" > <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit" value="login" /> </form> </body> </html> /userlogin Server Controller DB View Model <!DOCTYPE html> <html> <head>...</head> <body> <h1>Welcome : Imal</h1> </body> </html> <!DOCTYPE html> <html> <head>...</head> <body> <h1>Welcome : <%=username %></h1> </body> </html>
  • 4.
  • 5.
    Does Loading timematters ? • A survey revealed that loading time is major contributing factor to page abandonment • Page load time is greater than 3 seconds, 20% of visitors will abandon the page • Wallmart found that every 100ms reduction in loading time leads to an increase in incremental revenue by as much a 1%
  • 6.
    SPA <!DOCTYPE html> <html> <head> <link rel="stylesheet"type="text/css" href="main.css"> </head> <body> <div class="content"> <!--- Dynamically filling ---> </div> </body> <script src="bower/angular/angular.js"></script> <script src="bower/angular-route/angular-route.js"></script> <script src="js/app.js"></script> <script src="js/services.js"></script> <script src="js/controllers.js"></script> </html> <form method="POST" action="/userlogin" > <input type="text" name="username" /> <input type="password" name="password" /> <input type="submit" value="login" /> </form> <h1>Welcome : {{username}}</h1> /login /loginSuccess <div>Another HTML Content</div> /anotherUrl
  • 7.
    Benefits of SPA •Client Side Routing. • Client Side Rendering. • More responsive than normal web apps. • Because Most of the things happen in client side server load reduces. • SPA forces developers to create REST api so UI become just another client. • Perfect for supporting multiple platforms. Clients is more fatter and intelligent than before
  • 8.
  • 9.
    Why AngularJS ? •AngularJs built specifically focusing SPA Development. • Provide Client side MVC architecture. • Custom elements with directives. • Allows us to write less and manageable code. • Flexibility with filters. • Forces developers to do right things at right places. • Unit testing ready.
  • 10.
    Can you showus something working please?