SPA, Scalable Application & AngularJS

15
SPA, SCALABLE APPLICATION & ANGULARJS Mitch Chen

Transcript of SPA, Scalable Application & AngularJS

Page 1: SPA, Scalable Application & AngularJS

SPA, SCALABLE APPLICATION & ANGULARJS

Mitch Chen

Page 2: SPA, Scalable Application & AngularJS

WHAT IS SPA ?

Page 3: SPA, Scalable Application & AngularJS

SINGLE PAGE APPLICATION

Page 4: SPA, Scalable Application & AngularJS

SPA ECOSYSTEM CATEGORIES

Page 5: SPA, Scalable Application & AngularJS

SCALABLE APPLICATION

Page 6: SPA, Scalable Application & AngularJS

SA ARCHITECTURE

• Base Library (jQuery, Zepto.js etc.)

Page 7: SPA, Scalable Application & AngularJS

SA ARCHITECTURE

• Application Core (aka Application Controller)

✴ Manage Modules

✴ Handle Errors

✴ Enable Inter-Module Communication

✴ Extensible

✴ Can use Base Library

Page 8: SPA, Scalable Application & AngularJS

SA ARCHITECTURE

• Sandbox

✴ Facade for modules above the core (Security Guard)

✴ Interaction between modules via messages (events)

✴ Ensures a consistent interface

Page 9: SPA, Scalable Application & AngularJS

SA ARCHITECTURE•Modules

✴ Don’t know about each other, only about sandbox

✴ Call only own methods or sandbox methods

✴ DOM access only inside own box (But don’t use Base Library)

✴ No access to non-native global objects, don't create global objects

✴ Ask sandbox for anything you need, don't reference other modules

✴ Preferably no access to base library, use pure JS

Page 10: SPA, Scalable Application & AngularJS
Page 11: SPA, Scalable Application & AngularJS

ANGULARJS ARCHITECTURE• Base Library

✴ jQuery or AngularJS’s own jqLite implementation

• Application Core

✴ AngularJS itself

• Sandbox

✴ Scope passed to the controller

•Module

✴ AngularJS’s controller

Page 12: SPA, Scalable Application & AngularJS

KEY FEATURES OF ANGULARJS•Declarative HTML approach

• Easy Data-Binding

• Reusable Components

•MVC/MVVM Design Pattern

• Unit Testing

• Routing

• Templating

Page 13: SPA, Scalable Application & AngularJS

KEY FEATURES OF ANGULARJS•Modules

• Services

• Expressions

• Filters

•Directives

• Form Validation

• $scope, $http, $routeProvider

Page 14: SPA, Scalable Application & AngularJS

LET’S ANGULARJS !!

Page 15: SPA, Scalable Application & AngularJS

Q & A