THE ROAD TO ANGULAR 2.0

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

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

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

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

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

Lab 1 - Introduction to Angular

ANGULAR 10. Christian Ulbrich (Zalari)

IONIC. The Missing SDK For Hybrid Apps. Mike

Angular 4 Training Course Content

The magic behind. Angular 2+

Full Stack Web Developer

IN4MATX 133: User Interface Software

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

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

AngularJS AN INTRODUCTION. Introduction to the AngularJS framework

Angular 2 Programming

ADVANCED JAVASCRIPT #8

Demystifying Angular 2. SPAs for the Web of Tomorrow

Understanding Angular Directives By Jeffry Houser

Sample Copy. Not For Distribution.

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.

ANGULAR2 OVERVIEW. The Big Picture. Getting Started. Modules and Components. Declarative Template Syntax. Forms

AngularJS Examples pdf

AngularJS Introduction

AngularJS Fundamentals

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

3 Days Training Program

Angular 4 Syllabus. Module 1: Introduction. Module 2: AngularJS to Angular 4. Module 3: Introduction to Typescript

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

An Brief Introduction to a web browser's Document Object Model (DOM) Lecture 20 COMP110 Spring 2018

Upgrading to Ionic 3 APPENDIX D. Angular 4

Html basics Course Outline

Comprehensive Angular 2 Review of Day 3

Building Web Applications

Getting Started with

Vue.js Developer friendly, Fast and Versatile

AngularJS. Beginner's guide - part 1

Decoupled Drupal with Angular

FRONT END WEB. {< Course Details >}

Frontend UI Training. Whats App :

HTML DOM IN ANGULARJS

Jim Jackson II Ian Gilman

BOOSTING THE SECURITY OF YOUR ANGULAR 2 APPLICATION

Introduction to the SharePoint Framework Bob German Principal Architect - BlueMetal. An Insight company

LECTURE 3 ADMINISTRATION SECTION -A

Client Side JavaScript and AJAX

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

INTRODUCTION TO IONIC 2

Form Builder - User Guide

Connecting Angular and CFML

By the end of this Angular 6 tutorial, you'll learn by building a real world example application:

AngularJS. Beginner's guide - part 2

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

Full Stack Web Developer

Angular 2. Useful links. Allen Holub 2-1

Let's see a couple of examples

PHP + ANGULAR4 CURRICULUM 6 WEEKS

The course also includes an overview of some of the most popular frameworks that you will most likely encounter in your real work environments.

JavaScript CS 4640 Programming Languages for Web Applications

MASTERS COURSE IN FULL STACK WEB APPLICATION DEVELOPMENT W W W. W E B S T A C K A C A D E M Y. C O M

Stencil: The Time for Vanilla Web Components has Arrived

Dreamweaver Domain 5: Organizing Content by Using Dreamweaver CS5

High Performance Single Page Application with Vue.js

HTML. Mohammed Alhessi M.Sc. Geomatics Engineering. Internet GIS Technologies كلية اآلداب - قسم الجغرافيا نظم المعلومات الجغرافية

Concept - first iteration DAM 2.0 & CMIS

Ten interesting features of Google s Angular Project

Architectural Design. CSCE Lecture 12-09/27/2016

Sample CS 142 Midterm Examination

Table of Contents. Introduction 1. 1 Jumping Into JavaScript 5. for Loops 17

PHP WITH ANGULAR CURRICULUM. What you will Be Able to Achieve During This Course

Comprehensive AngularJS Programming (5 Days)

Interactive Design Working with SVGs

Guide for Administrators

Manual Html A Href Javascript Window Open In New

Index. alt, 38, 57 class, 86, 88, 101, 107 href, 24, 51, 57 id, 86 88, 98 overview, 37. src, 37, 57. backend, WordPress, 146, 148

Nagaraju Bende

C++\CLI. Jim Fawcett CSE687-OnLine Object Oriented Design Summer 2017

Seminar report Java Submitted in partial fulfillment of the requirement for the award of degree Of CSE

CST272 Getting Started Page 1

Element: Relations: Topology: no constraints.

PROFILE DESIGN TUTORIAL KIT

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

DATABASE SYSTEMS. Introduction to web programming. Database Systems Course, 2016

Advance Mobile& Web Application development using Angular and Native Script

IBM Bluemix Node-RED Watson Starter

Vue.js Framework. Internet Engineering. Spring Pooya Parsa Professor: Bahador Bakhshi CE & IT Department, Amirkabir University of Technology

The DOM and jquery functions and selectors. Lesson 3

APM. Object Monitor. Object Lab. Richard Hayton & Scarlet Schwiderski

CHANNEL9 S WINDOWS PHONE 8.1 DEVELOPMENT FOR ABSOLUTE BEGINNERS

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

Oracle Financial Consolidation and Close Cloud. What s New in the November Update (16.11)

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

AngularJS Intro Homework

Integrating Angular with ASP.NET Core RESTful Services. Dan Wahlin

Unit 3 - Week 2 lectures: Building your webapp

Advanced Angular & Angular 6 Preview. Bibhas Bhattacharya

One Framework. Angular

Edge Side Includes (ESI) Overview

SPIN Framework: PRESENTATION. Java Application Development made natural. p:

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

Transcription:

THE ROAD TO ANGULAR 2.0

ABOUT ME Angular 1.x apps ios apps REST API's in Java Maarten Hus, Developer @

WHY THIS TALK?

WAIT WHAT?!

GRAVEYARD

WHY?

DISCLAIMER

THE ROAD 1.x Template Syntax 2.0 Types Bindings ES6 Components

TEMPLATE SYNTAX Angular 2.0's template syntax is radically different from 1.x's.

DIFFERENCES 1.x <span>username: {{user.username}}</span> <img ng-src="{{ user.imageurl }}"/> <button ng-click="upvote(user)">+1</button> 2.0 <span>username: {{user.username}}</span> <img [src]="{{ user.imageurl }}"/> <button (click)="upvote(user)">+1</button>

DIFFERENCES 1.x <span>username: {{user.username}}</span> <img ng-src="{{ user.imageurl }}"/> <button ng-click="upvote(user)">+1</button> 2.0 <span>username: {{user.username}}</span> <img [src]="{{ user.imageurl }}"/> <button (click)="upvote(user)">+1</button>

DIFFERENCES 1.x <span>username: {{user.username}}</span> <img ng-src="{{ user.imageurl }}"/> <button ng-click="upvote(user)">+1</button> 2.0 <span>username: {{user.username}}</span> <img [src]="{{ user.imageurl }}"/> <button (click)="upvote(user)">+1</button>

DIFFERENCES 1.x <span>username: {{user.username}}</span> <img ng-src="{{ user.imageurl }}"/> <button ng-click="upvote(user)">+1</button> 2.0 <span>username: {{user.username}}</span> <img [src]="{{ user.imageurl }}"/> <button (click)="upvote(user)">+1</button>

2.0 SYNTAX [] => property binding, is an expression () => event, is a statement, caused by the user.

NO NEED FOR ng-bind, ng-src, ng-class, ng-href, ng-show, ng-hide, ng-click, ng-enabled, ng-disabled, ng-blur, ng-keyup, ngmouse-down etc etc

EASIER TO LEARN Angular 2.0 templates are closer to HTML.

REASONING The new syntax makes it easer to reason about templates.

THE ROAD 1.x Template Syntax 2.0 Types Bindings ES6 Components

MODULES ES6 Modules are bundles of 'code' from which you can import specific 'code'.

EXAMPLE A // MathFuctions.js export function square(x) { return x * x; } B // main.js import {square} from 'MathFuctions'; console.log(square(5)); // logs 25 to console

ANGULAR 2.0 import {Component, View} from 'angular2/angular2';

ANGULAR 1.X angular.module('users').factory('userfactory', ['$http', function($http) { // code for userfactory which uses $http }]);

ANGULAR 2.0 Why create your own a module system, when the language (ES6) hands it to you.

HE'S DEAD JIM

THE ROAD 1.x Template Syntax 2.0 Types Bindings ES6 Components

TYPESCRIPT

ANGULAR 2.0 import {Component, View} from 'angular2/angular2'; @Component({selector: 'person'}) @View({ template: `<p>my name: {{ name }}</p>` }) class PersonComponent { name: string; friends: Array<string>; } constructor(name: string) { this.name = name; }

@COMPONENT import {Component, View} from 'angular2/angular2'; @Component({selector: 'person'}) @View({ template: `<p>my name: {{ name }}</p>` }) class PersonComponent { name: string; friends: Array<string>; <person></person> } constructor(name: string) { this.name = name; }

@VIEW import {Component, View} from 'angular2/angular2'; @Component({selector: 'person'}) @View({ template: `<p>my name: {{ name }}</p>` }) class PersonComponent { name: string; friends: Array<string>; } constructor(name: string) { this.name = name; }

TYPES import {Component, View} from 'angular2/angular2'; @Component({selector: 'display'}) @View({ template: `<p>my name: {{ name }}</p>` }) class PersonComponent { name: string; friends: Array<string>; } constructor(name: string) { this.name = name; }

WHY TYPES? 1. IDE's and Text Editors love types. 2. Types help show your intent.

THE ROAD 1.x Template Syntax 2.0 Types Bindings ES6 Components

COMPONENTS Component Controller View

COMPONENT import {Component, View} from 'angular2/angular2'; @Component({selector: 'display'}) @View({ template: `<p>my name: {{ name }}</p>` }) class PersonComponent { name: string; friends: Array<string>; View Controller } constructor(name: string) { this.name = name; }

INPUT / OUTPUT Component Input Controller Output View

I/O If is explicitly imported import {View, If} from 'angular2/angular2'; @View({ template: `<p *if="name.length > 3">My name: {{ name }}</p>`, directives: [If] }) Components must state their dependencies (input).

I/O import {Component} from 'angular2/angular2'; @Component({ selector: 'person', properties: { name: 'name' }, events: ['upvote'] }) <person [name]="firstname"></person>

I/O import {Component} from 'angular2/angular2'; @Component({ selector: 'person', properties: { name: 'name' }, events: ['upvote'] }) <person (upvote)="vote()"></person>

WHY COMPONENTS 1. Components have clearly defined inputs and outputs. 2. Components are composable 3. Components can easily be reused.

ANGULAR 1.X Directives Controllers

THEY LIVE!

THE ROAD 1.x Template Syntax 2.0 Types Bindings ES6 Components

BINDINGS Angular 2.0 will no longer have two way bindings.

ANGULAR 1.X D A C B

EXPENSIVE Digest Phase A Cycle B

UNPREDICTABLE <div ng-controller="personcontroller as personcontroller"> <h1>hi {{ personcontroller.person.name }} <person-view person="personcontroller.person"></person-view> </div>

UNNECESSARY A <h1>hi {{ name }}</h1> B <input type="text" value="{{ name }}">

ANGULAR 2.0 How does Angular 2.0 handle bindings?

WEATHER APP

TREE OF COMPONENTS WeatherApp SegmentedButton Grid SearchBar WeatherStation WeatherStation WeatherStation

ANGULAR 2.0 A A B B bindings [] go down events () go up

CHANGE DETECTION 1.x Digest Phase Digest Phase 2.0 Cycle

SPEED

MEMORY

< MEMORY =

THE ROAD 1.x Template Syntax 2.0 Types Bindings ES6 Components

MIGRATION? 1.x 2.0

MIGRATION Big Bang 1.x 2.0 Incremental

BIG BANG

INCREMENTAL

WHAT TO CHOOSE? Big Bang Incremental Small App Big App Few dependencies Many dependencies If you have the time If there is no time

EXAMPLE: A Big Bang Incremental Small App Big App Few dependencies Many dependencies If you have the time If there is no time

EXAMPLE: B Big Bang Incremental Small App Big App Few dependencies Many dependencies If you have the time If there is no time

PREPARING FOR 2.0 1. Upgrade to 1.4 2. Use the new router 3. Use ES6 classes

DONE 1.x Template Syntax 2.0 Types Bindings ES6 Components

CONCLUSION

CONCLUSION jqlite DDO angular. module Controllers $scope

THE END During the conference you can find me at the 42's stand. So if you have any questions you know where to find me.