Tim Roes. Android- & inovex in Karlsruhe. GDG Karlsruhe Co-Organizer.

Similar documents
3 Days Training Program

AngularJS AN INTRODUCTION. Introduction to the AngularJS framework

What is AngularJS. à Javascript Framework à MVC à for Rich Web Application Development à by Google

AngularJS. Beginner's guide - part 2

AngularJS. Beginner's guide - part 1

Nagaraju Bende

AngularJS Examples pdf

Frontend Frameworks. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Single Page Applications

Angular 2 Programming

Dynamic Web Development

Angular 4 Training Course Content

ANGULARJS INTERVIEW QUESTIONS

AngularJS Fundamentals

ANGULARJS - MOCK TEST ANGULARJS MOCK TEST II

Design and Implementation of Single Page Application Based on AngularJS

Introduction to AngularJS

AngularJS. CRUD Application example with AngularJS and Rails 4. Slides By: Jonathan McCarthy

Full Stack Web Developer

AngularJS. CRUD Application example with AngularJS and Rails 4. Slides By: Jonathan McCarthy

ANGULAR 2.X,4.X + TYPESRCIPT by Sindhu

JSON POST WITH PHP IN ANGULARJS

AngularJS Introduction

input[datetime-local] DIRECTIVE IN ANGULARJS

JavaScript Framework: AngularJS

Getting Started with

Web Application Development

THE HITCHHIKERS GUIDE TO. Harper Maddox CTO, EdgeTheory 30 September 2014

IONIC. The Missing SDK For Hybrid Apps. Mike

Financial. AngularJS. AngularJS. Download Full Version :

Full Stack Web Developer

Financial. AngularJS. AngularJS.

Single Page Applications using AngularJS

Creating Effective Websites using AngularJS

AngularJS Intro Homework

Comprehensive Angular 2 Review of Day 3

Angular 2: What s new? Jonas Bandi, IvoryCode GmbH

Lazy Loading Techniques

Tarek Elachkar, VP Customer Solutions - Jahia A real world story of Angular and Apache Unomi integration.

Sample Copy. Not For Distribution.

ngphotos (Grails + AngularJS)

Comprehensive AngularJS Programming (5 Days)

HTML DOM IN ANGULARJS

P a g e 1. Danish Technological Institute. Scripting and Web Languages Online Course k Scripting and Web Languages

Input and Validation. Mendel Rosenblum. CS142 Lecture Notes - Input

Das Frontend ist ja dann trivial - Microservices und Web-Frontends. Matthias Reuter & Michael Bruns Darmstadt,

CodeValue. C ollege. Prerequisites: Basic knowledge of web development and especially JavaScript.

AngularJS Step By Step Tutorials. $interval([function], [delaytime], [count], [invokeapply], [parameter]);

Questions and Answers from Lukas Ruebbelke s AngularJS In-Depth Course

A Model-Driven Development of Web Applications Using AngularJS Framework

IN4MATX 133: User Interface Software

a Very Short Introduction to AngularJS

Software Architecture Documentation for the JRC MYGEOSS app for Invasive Species project

"Charting the Course... Comprehensive Angular. Course Summary

,

Building mobile app using Cordova and AngularJS, common practices. Goran Kopevski

Getting MEAN. with Mongo, Express, Angular, and Node SIMON HOLMES MANNING SHELTER ISLAND

Building JSR-286 portlets using AngularJS and IBM Web Experience Factory

Simple AngularJS thanks to Best Practices

Front End Programming

Basics of Web Technologies

EXPRESSIONS IN ANGULARJS

Angular 2 and TypeScript Web Application Development

Understanding Angular Directives By Jeffry Houser

Persistence. SWE 432, Fall 2017 Design and Implementation of Software for the Web

<?php function preprocess_drupalcon($presentation) { if ($drupal && $ionic) { if ($ionic[ app ] = Megalomaniac ) { create $presentation } } }?

Prototyping a Social Network. AngularJS: Firebase integration with AngularFire

- MEAN Stack חזרה. MongoDB - as the database Express - as the web framework AngularJS - as the frontend framework NodeJS- as the server platform

Reading Writing Speaking Reading Writing Speaking. English Intermediate Intermediate Elementary Intermediate Intermediate Elementary

INTRODUCTION TO IONIC 2

Watch Angular Js and Node Js Demo Video Here: Why Training with Us?

NIELSEN API PORTAL USER REGISTRATION GUIDE

Building Web Applications

Source. Developer Guide / forms

REST API Operations. 8.0 Release. 12/1/2015 Version 8.0.0

Static Webpage Development

UI Course HTML: (Html, CSS, JavaScript, JQuery, Bootstrap, AngularJS) Introduction. The World Wide Web (WWW) and history of HTML

Front End. Presentation Layer. UI (User Interface) User <==> Data access layer

Source. Developer Guide / module

Advance Mobile& Web Application development using Angular and Native Script

Manual Html A Href Onclick Submit Form

Tools for Accessing REST APIs

Angular2. Bernhard Niedermayer. Software Development playing around with Angular2 since alpha.

MEAN Stack. 1. Introduction. 2. Foundation a. The Node.js framework b. Installing Node.js c. Using Node.js to execute scripts

IN ACTION. Lukas Ruebbelke. FOREWORD BY Martin Gontovnikas MANNING SAMPLE CHAPTER

Databases/JQuery AUGUST 1, 2018

Watch AngularJS and NodeJS Demo Video Here:

Developing Applications with Alfresco s Unified REST APIs. Will Abson, Alfresco

AngularJS - Walkthrough

Controller/server communication

A conditional statement can compare two values. Here we check if one variable we declared is greater than another. It is true so the code executes.

Modern and Responsive Mobile-enabled Web Applications

Data-Centric Single Page Apps with Angular, Web API, and Breeze

Arjen de Blok. Senior Technical Consultant bij ICT Groep ( sinds 1995 Programmeren sinds 1990 Technologiën. Links

FRONT END WEB. {< Course Details >}

PyBossa.JS JavaScript library for PyBossa

Courslets, a golf improvement web service. Peter Battaglia

Future Web App Technologies

A WEB BASED OFFICE MARKET. CS 297 Project Report Presented to Dr. Christopher Pollett San José State University

Connecting Angular and CFML

Transcription:

AngularJS Workshop

Tim Roes Android- & Web-Developer @ inovex in Karlsruhe GDG Karlsruhe Co-Organizer www.timroes.de/+

Matthias Reuter Web-Developer @ inovex in Karlsruhe @gweax

Multipage Application GET A GET Server Datenbank B

Single Page Application (SPA) GET A AJAX Webserver B AJAX REST-API Datenbank

Angular Terminology Module Model Services Factories Providers Controller Scope 2-Way Databinding View Directives Filters

Angular Modules ng-app HTML <!DOCTYPE html> <html ng-app= demo > </html> JavaScript Module Name angular.module( demo, []); Dependencies / Required modules

Angular binding values HTML <div> {{ 2 + 2 }} </div> JavaScript binding

Angular Controller / Scope HTML <body ng-controller= MainController > Hello {{ name }} </body> name variable on the scope Controller name JavaScript var app = angular.module( demo, []); app.controller( MainController, function($scope) { $scope.name = World ; Injected dependencies (Services, Filters, etc.)

ng-model HTML ng-model directive <body ng-controller= MainController > </body> <input type= text ng-model= name placeholder= Your name > Hello {{ name }} JavaScript var app = angular.module( demo, []); app.controller( MainController, function($scope) { 2-way databind name to input of text field $scope.name = World ;

ng-show / ng-hide HTML ng-show shows element, when condition is true <body ng-controller= MainController > Known associates: <div ng-show= name === Henning > Lukas, Benjamin </div> </body> <span ng-hide= name === Daniel >Mostly</span> harmless ng-hide hides element, when condition is true

ng-repeat HTML ng-repeat, for-each over clients with client as loop variable <ul> <li ng-repeat= client in clients > {{ client.name }}, {{ client.firstname }} </li> </ul> JavaScript $scope.clients = [ { name: Beeblebrox, firstname: Zaphod }, { name: Dent, firstname: Arthur } ];

ng-submit / ng-click HTML ng-submit: function will be called when form submits <form ng-submit= adduser() > <input type= text placeholder= Name ng-model= user.name > <input type= text placeholder= Firstname ng-model= user.firstname > <button ng-click= adduser() >Add User</button> </form> JavaScript ng-click executes function when element is clicked $scope.adduser = function() { $scope.users.push({ name: $scope.user.name, firstname: $scope.user.firstname $scope.user = {}; };

Filters HTML applies the filter after the pipe to the clients variable <input type= text ng-model= query placeholder= Search > <div ng-repeat= client in clients filter:query > </div> filter for objects containing the content of the query variable

services JavaScript.service creates a new service, bind methods at `this` app.service( UserService, function() { var users = [...]; this.getallusers = function() { return users; }; this.adduser = function(user) { users.push(user); }; app.controller( MainController, function(userservice) { $scope.users = UserService.getAllUsers(); inject UserService and call its methods

$http service JavaScript inject $http service for HTTP requests app.controller( MainController, function($http) { $http.get( http://api.openweathermap.org/data/2.5/find?q=karlsruhe,de ).then(function(response) { var data = response.data; // actual body of response $scope.temp = data.main.temp; $scope.desc = data.weather.description; $http methods return a Promise, which has a method.then(), which you can pass a function that will be called, as soon as the result is ready Promises explained: http://andyshora.com/promises-angularjs-explained-as-cartoon.html

ngroute - Configuration JavaScript Dependency to ngroute module angular.module( demo, [ ngroute ]).config(function($routeprovider) { $routeprovider.when( /clients, { templateurl : views/clientlist.html, controller: ClientListController }).when( /client/:id, { templateurl: views/client.html, controller: ClientDetailController }).otherwise({ redirectto: /clients configure different routes, with a template to load, and a controller to use module.config() method will be called to set up all services, etc. some services expect configuration here

ngroute - Controller The place where the templateurl will be loaded to HTML <div ng-view></div> JavaScript $routeparams service give access to placeholders as defined in /client/:id route app.controller( ClientDetailController, function($scope, $routeparams, ClientService) { $scope.client = ClientSerice.getClientById($routeParams.id);

www.firebase.com

Angular Firebase JavaScript angular.module( myapp, [ firebase ]).controller(function($scope, $firebasearray) { Require the firebase module as dependency var ref = new Firebase( https://<yourapp>.firebaseio.com/clients ); $scope.clients = $firebasearray(ref); $scope.addclient = function(client) { $scope.clients.$add(client); }; Your project URL (and database path)

Angular Firebase - Auth JavaScript angular.module( myapp, [ firebase ]).controller(function($scope, $firebaseauth) { var ref = new Firebase( https://<yourapp>.firebaseio.com/clients ); var auth = $firebaseauth(ref); $firebaseauth service provides authentication methods auth.$authwithoauthpopup( twitter ).then(function(response) { // response contains information about user }, function() { // wrong login data

Links: - www.angularjs.org - www.angular.io (Preview Angular 2) - github.com/timroes/angular-starter-template - firebase.com - codeschool.com/courses/shaping-up-with-angular-js - www.youtube.com/user/ngconfvideos