angular js

32
ANGULARJS BY RENAUD HOYOUX

Upload: jeremie-fays

Post on 23-Feb-2017

26 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Angular js

ANGULARJS

BY

RENAUD HOYOUX

Page 2: Angular js

ABOUT MELead Developer

FullStack Developer

Attaché

...

on the Histoweb project (Cytomine software).

Page 3: Angular js

ABOUT CYTOMINE

Page 4: Angular js

ANGULAR ? WHAT IS THAT ?*Angular, Angular, est-ce que j'ai une gueule d'Angular ?*

Page 5: Angular js

ANGULARJSFramework Frontend100% JavascriptOpen sourceMV*Maintained by Google

Page 6: Angular js

WHAT'S ORIGINAL ?

Page 7: Angular js

PARADIGMMost alternatives Angular

Explicit DOM modication Natural DOM extension

Imperative Declarative

Page 8: Angular js

ARCHITECTURE

Page 9: Angular js

BASED ONModuleControllerScopeService

Page 10: Angular js

MAIN CHARACTERISTICSjqLite, Data Binding, Directives, Form Validation, Filters,

Dependency Injection.

Page 11: Angular js

JQLITEsubset of jQuery that implements only the most commonly

needed functionality.

Page 12: Angular js

One way

DATA BINDING

<!DOCTYPE html><html ng­app="exampleApp" > <head> <script src="angular.js"></script> <script>

</script> </head> <body ng­controller="dayCtrl"> Today is day </body></html>

angular.module("exampleApp", []) .controller("dayCtrl", function ($scope) $scope.day = new Date(); );

Page 13: Angular js

Two way

DATA BINDING

<!DOCTYPE html><html ng­app="exampleApp" > <head> <script src="angular.js"></script> <script> angular.module("exampleApp", []) .controller("nameCtrl", function ($scope) //$scope.me = "Renaud"; ); </script> </head> <body ng­controller="nameCtrl"> <input ng­model="me"> <br/> I am me </body></html>

Page 14: Angular js

DIRECTIVESExtend and enhance HTML.Lots of built-in directives.Contain the DOM manipulation.

Page 15: Angular js

FORM VALIDATION

Page 16: Angular js

FILTERSFormat the data displayed to the user.Can be used throughout a module.

Page 17: Angular js

DEPENDENCY INJECTION<!DOCTYPE html><html ng­app="exampleApp" > <head> <script src="angular.js"></script> <script> angular.module("exampleApp", []) .controller("dayCtrl", function ($scope, $filter, $http, days) //... ); </script> </head> <body><!­­ Lot of cool stuff­­> </body></html>

Page 18: Angular js

DEMO ?

Page 19: Angular js

DEMODIRECTIVES

ng-repeat, ng-show, ng-if,...

Page 20: Angular js

DEMOFILTERS

Page 21: Angular js

DEMOFORM VALIDATION

Page 22: Angular js

CONVINCED ?

Page 23: Angular js

DON'T FORGET !It is still JS !

Page 24: Angular js

INHERITANCE<!DOCTYPE html><html ng­app="exampleApp"> <body ng­controller="topLevelCtrl"> <h4>Top Level Controller</h4> <div class="input­group"> <input class="form­control" ng­model="dataValue"> </div> <div ng­controller="firstChildCtrl"> <h4>First Child Controller</h4> <div class="input­group"> <input class="form­control" ng­model="dataValue"> </div> </div> <div ng­controller="secondChildCtrl"> <h4>Second Child Controller</h4>

Page 25: Angular js

MAIN DRAWBACKAngular is dying

Page 26: Angular js

WHO KILLED LAURA PALMER ANGULAR ?ANGULAR2

Page 27: Angular js

WHAT IS DIFFERENT ?ControllerServiceModule$scopejqLiteDirectiveDependency InjectionComponentClasses

Page 28: Angular js

WHAT IS DIFFERENT ?

Page 29: Angular js

“Mais à part ça, Madame la Marquise, tout vatrès bien, tout va très bien.”

Page 30: Angular js

WHY SHOULD I LEARN IT ?“Different languages solve the same problemsin different ways. By learning several different

approaches, you can help broaden yourthinking and avoid getting stuck in a rut.”

The Pragmatic Programmer: From Journeyman to Master

Page 31: Angular js

HOW ?JHipster

Page 32: Angular js

Follow me on Twitter Demo les are on

https://github.com/geektortoise/angular_demo

THE END@TheGeekTortoise

GitHub