27
ANGULARJS INTRO @AJSZRH

AngularJS Introduction

Embed Size (px)

DESCRIPTION

AngularJS is an open-source JavaScript framework from Google that makes developing rich web applications much easier. Slides used in the fisrt AngularJS Zürich Meetup. Code can be found at https://github.com/carlos-/ajs-intro

Citation preview

Page 1: AngularJS Introduction

ANGULARJS INTRO @AJSZRH

Page 2: AngularJS Introduction

GRACIAS!

Page 3: AngularJS Introduction

- Where are we? - AngularJS - Let’s build something - Future of this group

AGENDA

Page 4: AngularJS Introduction

SOME BACKGROUND

Page 5: AngularJS Introduction
Page 6: AngularJS Introduction
Page 7: AngularJS Introduction
Page 8: AngularJS Introduction

Static HTML Dynamic HTML HTML + CSS + JavaScript

Dynamic web pages Server rendered the HTML pages

Ajax: Asynchronous JavaScript XML DOM manipulation

Model View ViewModel (MVVM) The Single-Page App

Page 9: AngularJS Introduction

WHAT IS ANGULARJS HTML enhanced for web apps!

AngularJS is NOT

-  Library

-  Does not abstract away HTML, CSS or JS

AngularJS is

-  JavaScript Framework

-  Extends HTML into more readable format

-  Reduces DOM manipulation

-  Allows easier testing

Page 10: AngularJS Introduction

DIRECTIVES & DATA BINDING

Page 11: AngularJS Introduction

AngularJS lets you extend HTML vocabulary for your application.

DIRECTIVES

ng-app boostraps angular

ng-init directive

ng-model directive

Page 12: AngularJS Introduction

LET’S START CODING SOMETHING DIRECTIVES & DATA BINDING

Page 13: AngularJS Introduction

DATA BINDING

docs.angularjs.org

Synchronization of data between the model and view components

Page 14: AngularJS Introduction

GET REAL! EXAMPLE APP

Page 15: AngularJS Introduction

PIZZERIA …

Page 16: AngularJS Introduction

FILTERS CONTROLLER 1 CONTROLLER 2

SERVICE

$HTTP

Page 17: AngularJS Introduction

VIEWS, CONTROLLERS & SCOPE Business logic needed for each single view

Define module

Define controller

$scope the glue between application controller and view

VIE

W

CO

NTR

OLL

ER

Page 18: AngularJS Introduction

SERVICE $HTTP Core Angular service connects to remote HTTP servers

Inject $http

Use it to get data!

Page 19: AngularJS Introduction

SHOP EXAMPLE VIEWS, CONTROLLERS & SCOPE

Page 20: AngularJS Introduction

FILTERS Filters format the value of an expression for display.

data

many filters to expression

filter with argument

filter without argument

Page 21: AngularJS Introduction

SHOP EXAMPLE FILTERS

Page 22: AngularJS Introduction

SERVICES Services are used to communicate controllers

Register service

Define functions

Return instance

Inject in controllers

Page 23: AngularJS Introduction

SHOP EXAMPLE SERVICES

Page 24: AngularJS Introduction

FUTURE TOPICS -  Routing

-  Support framework: yeoman, grunt, bower

-  Testing: Unit testing vs. e2e testing. Karma, Yasmine

-  Talking to server

-  Security: authentication and authorization

-  Angular services

-  Building Forms

-  i18n and l10n

-  Animations

-  Directives

-  Building phone apps with AngularJS

Page 25: AngularJS Introduction

LEARN, SHARE & BUILD

Page 26: AngularJS Introduction

MANY THANKS http://about.me/Carlos_Morales

Page 27: AngularJS Introduction

BEHIND THE SCENES Initialization

docs.angularjs.org