Bibby Chung
Me
• Study4Love 2013/2015 Speaker
• twMVC Cofounder & Speaker
• Techdays Taiwan 2014 MVP Geek Speaker
• Mobile & Devices Developer
• Microsoft MVP (since 2009)
Agenda
• Motivation
• Preparation For Angular 2.0
• Component
• Getting Started
• Resources
Angular 2.0
AngularJS 1.X is built for current browsers while AngularJS 2.0 is being
built for the browsers of the future.
-- Igor Minar
Motivation
• Performance
• Productivity
• Standards
• Cross Platform
Performance
https://instapage.com/blog/google-accelerated-mobile-pages
Performance
https://instapage.com/blog/google-accelerated-mobile-pages
Performance
Performance
• Angular 2 in alpha was already 5x faster than Angular 1.
• Angular 2 in beta claims to be anywhere from 5-10 times faster.
Performance
Online Tests
http://rafaelaudy.github.io/angular-1-and-2-state/
Performance
Performance
• Server Side
• SEO
• Plugin
Server
Client
Performance
• Server Side
• SEO
• Plugin
Performance
• Server Side
• SEO
• Plugin
Performance
• Angular 1.x
• Compile -> Render -> Compile -> Render
• Angular 2.0
• Compile -> Render -> Render -> Render
• Precompile -> Render -> Render -> Render
Performance
• Angular 1.x
• Compile -> Render -> Compile -> Render
• Angular 2.0
• Compile -> Render -> Render -> Render
• Precompile -> Render -> Render -> Render
Performance
• Unidirectional Flow
• Immutable Object
• Object.Observe()
Performance
• Unidirectional Flow
• Immutable Object
• Object.Observe()
Performance
• Unidirectional Flow
• Immutable Object
• Object.Observe()
https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Object/observe
Performance
• View Caching
• Memory Efficient
Productivity
Productivity - Concepts
Angular 1.x has many concepts. Concepts have a learning curve
Productivity - Concepts
Make your intention clear using natural, easy-to-write syntax. Reduce complexity for your team: new,
structure-rich templates are readable and easy to understand at a glance.
Productivity - Overview
Productivity - Syntax
Productivity - Syntax
Standards
• ECMAScript 6 / ECMAScript 7
• Module
• Class
• Arrow Function
• Decorator
• HTML 5
• Web Component
• Shadow DOM
• Template
Cross Platform
• Web
• Browser (LEGACY BROWSER SUPPORT In addition to fully supporting latest
versions of Chrome, Edge, Firefox, IE, and Safari, Angular 2 is also tested for
older browsers including IE9+ and Android 4.1+.)
• Devices
• Hybrid (Ionic)
• Native (NativeScript)​​​​
Are you interested in
angular 2.0 ?
When is the first final release
of angular 2.0
Preparation For Angular 2.0
Preparation For Angular 2.0 - TypeScript
TypeScript
=
Types + Javascript
Preparation For Angular 2.0 - TypeScript
TypeScript is a typed superset of JavaScript that compiles to plain JavaScript.
Any browser. Any host. Any OS. Open Source.
Preparation For Angular 2.0 - TypeScript
• Better overall code readability in large codebases
• Ease of refactoring
• Use new ESMAScript 6/7 features in old browsers.
• IntelliSense auto suggest in code editors
• Compile TypeScript to JavaScripts (show errors)
Preparation For Angular 2.0 - TypeScript
• Better overall code readability in large codebases
• Ease of refactoring
• Use new ESMAScript 6/7 features in old browsers.
• IntelliSense auto suggest in code editors
• Compile TypeScript to JavaScripts (show errors)
Preparation For Angular 2.0 - TypeScript
• Better overall code readability in large codebases
• Ease of refactoring
• Use new ESMAScript 6/7 features in old browsers.
• IntelliSense auto suggest in code editors
• Compile TypeScript to JavaScripts (show errors)
Preparation For Angular 2.0 - TypeScript
• Better overall code readability in large codebases
• Ease of refactoring
• Use new ESMAScript 6/7 features in old browsers.
• IntelliSense auto suggest in code editors
• Compile TypeScript to JavaScripts (show errors)
Preparation For Angular 2.0 - TypeScript
• Better overall code readability in large codebases
• Ease of refactoring
• Use new ESMAScript 6/7 features in old browsers.
• IntelliSense auto suggest in code editors
• Compile TypeScript to JavaScripts (show errors)
Preparation For Angular 2.0 - TypeScript
Hello, Bibby
Preparation For Angular 2.0 - TypeScript
Class
Preparation For Angular 2.0 - TypeScript
Interface
Preparation For Angular 2.0 - TypeScript
Module
Preparation For Angular 2.0 - Tools
• Adobe Brackets
• GitHub Atom
• Sublime Text
• JetBrains Editors
Visual Studio Code
How to install and use those?
• TypeScript
http://www.typescriptlang.org
• Visual Studio Code
https://code.visualstudio.com
Is it ready for your
coding environment?
Component
Component Directive View (Template)
Component - Directive
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component - View
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component - View
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component
http://victorsavkin.com/post/118372404541/the-core-concepts-of-angular-2
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Component
http://victorsavkin.com/post/118372404541/the-core-concepts-of-angular-2
• Component Definition
• Inputs / Outputs
• Lifecycle Hooks
• Data Flow
Let’s start...
Getting Started
Demo - Hello World
Getting Started
Demo - Component with Service
Getting Started
Demo - Directive
Resources
• References
• https://angular.io/
• https://angular.io/docs/ts/latest/guide/cheatsheet.html
• https://angular.io/docs/ts/latest/api/
• Videos
• https://goo.gl/5s2zkF
Contact Me
• http://fb.me/bibbynet (Facebook)
• https://tw.linkedin.com/in/bibbychung (Linkedin)
• http://bibby.be (Blog)
• https://github.com/BibbyChung (GitHub)
Workshop
Example - Hello World
Workshop
Example - TodoList

Angular2.0@Shanghai0319

Editor's Notes

  • #27 https://github.com/tastejs/todomvc 這是很簡單的一個 hello world. 可以看出語義的差異
  • #47 anything is a component.
  • #55 http://victorsavkin.com/post/118372404541/the-core-concepts-of-angular-2
  • #56 http://victorsavkin.com/post/118372404541/the-core-concepts-of-angular-2