17
ANGULARJS A Gentle Introduction John Ptacek/@jptacek www.SkylineTechologies.com / www.jptacek.com [email protected]

ANGULARJS A Gentle Introduction John Ptacek/@jptacek / [email protected]

Embed Size (px)

Citation preview

Page 1: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

ANGULARJSA Gentle Introduction

John Ptacek/@jptacekwww.SkylineTechologies.com / www.jptacek.com

[email protected]

Page 2: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• AngularJS Overview• Demos

AGENDA

Page 3: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

OVERVIEW• http://alicialiu.net/leveling-up-angular-talk/#/

Page 4: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Framework. NOT a Library-Contains everything you need for SPA

• Broken into components– Controllers, view, models, services, etc

• MVC/MVVM Framework• Two Way Data binding• Enables test friendly code

ANGULARJS – THE WHY

Page 5: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Performance- Framework not a library- Functions, not computed properties

• Directives– Powerful, not always intuitive

• Documentation

ANGULARJS – THE WHY NOT

Page 6: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Get AngularJS• Ng-app, ng-model• Magical {{}}• Filters– http://docs.angularjs.org/api/ng#filter

DEMO 1 - INTRO/DATA BINDING

Page 7: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Ng-controller– http://docs.angularjs.org/api/ng.$controller

• Magical $scope– View model– Object context

DEMO 2 - CONTROLLERS

Page 8: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Directives– HTML Dom markers (attributes, css class, etc)– http://docs.angularjs.org/guide/directive

• Ng-repeat– http://docs.angularjs.org/api/ng.directive:ngRepeat

• Ng-filter– http://docs.angularjs.org/api/ng.filter:filter

DEMO 3 –REPEAT AND FILTER

Page 9: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Order By– http://docs.angularjs.org/api/ng.filter:orderBy

• Ng-repeat– http://docs.angularjs.org/api/ng.directive:ngRepeat

• Ng-filter– http://docs.angularjs.org/api/ng.filter:filter

DEMO 4 –MORE REPEAT AND ORDER

Page 10: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Custom Logic• Custom Filter function

DEMO 5 – FUNCTIONS

Page 11: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Binding Images• And something really cool

DEMO LOU – A BRIEF INTERLUDE

Page 12: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Ng-show/ng-hide– http://docs.angularjs.org/api/ng.directive:ngShow#!– http://docs.angularjs.org/api/ng.directive:ngHide

• Ng-click– http://docs.angularjs.org/api/ng.directive:ngClick

• Directives– http://docs.angularjs.org/api/

DEMO 6 - DIRECTIVES

Page 13: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Encapsulate logic– Linked together via Dependency injection– http://

docs.angularjs.org/guide/dev_guide.services.creating_services

• chemistryApp.factory('chemistryData', function($http, $log, $q) {

return { getChemistryData: function() {}});• Promises - $q– http://docs.angularjs.org/api/ng.$q

DEMO 7 - SERVICES

Page 14: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Create new elements!

DEMO 8 – DATA BINDING

Page 15: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

QUESTIONS

Page 16: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

• Mile of Music

INTERESTED?

Page 17: ANGULARJS A Gentle Introduction John Ptacek/@jptacek  /  jptacek@SkylineTechnologies.com

John PtacekSkyline Technologies

[email protected]

@jptacek / www.jptacek.com

THANK YOU!!