The evolution of Angular 2
Angular 1 was born in 2009. Since that a lot of web standards are born and supported by most of the browsers natively. So it's time to use the new possibilities. That's how Angular 2 started. It's not just a major update. It's a whole rewrite!
The key theme of this talk it to get an overview of Angular 2. I’ll walk you through what you need to know to stay up to date, explain the main concepts behind A2 and the current state.
It is rounded off with some practical suggestions on how to proceed today - to make the transition from Angular 1.x to Angular 2.x easier.
Original slides with animated gifs can be found here: https://docs.google.com/presentation/d/122ptcLESkfSw8omK9ekG8FksD_zvegGrqOL2GR5PE80/edit?usp=sharing
8. “We’re designing Angular 2 for the
way the world will look when we
believe folks will use it. In particular,
this means targeting modern browsers
and using ECMAScript 6.”
from the official Angular announcement
10. Angular 2
• For “evergreen” Browsers
• Chrome, Firefox, Opera, Safari and IE11
• Chrome on Android, iOS6+, Windows Phone 8+, FF mobile
• Instrumented
• Angular-wide logging service
• diary.js
11. Angular 2
• Modular
• Every piece of Angular 2 is optional & replacable
• Mobile first, Offline support
• Simplify
• Directives
• Templating
• IDE can validate and analyze
• Performance
• Improve first load time with prerendering
• Superfast change detection
12.
13.
14.
15. Angular 2
Angular 2.0 is written in TypeScript
You can write your code either in TS, ES6 or ES5
19. Annotations in ES5
// Constructor function
function AngularJSMunichApp() { }
// Annotations attached to function
AngularJSMunichApp.annotations = [
new Component({ selector: 'angular-js-munich-app' }),
new View({ url: 'angular-js-munich.html' })
];
customize the components
23. Template Syntax
Consists of 3 main features
#localVar - Local Variables
[innerText] - Property Binding
(click) - Event Handler
24. Template Syntax
Consists of 3 main features
<!-- # creates a local variable inside the template -->
<input #textbox>
<!-- (event) registers an event handler -->
<button (click)="addTodo(textbox.value)"> Add </button>
<!-- [property] binds a value to a property of a DOM element or
component -->
<div [innertext]="textbox.value"></div>
25. Template Syntax
Nofity about errors immediately
<!-- # creates a local variable inside the template -->
<input #textbox>
<!-- (event) registers an event handler -->
<button (clikc)="addtodo(textbox.value)"> Add </button>
<!-- [property] binds a value to a property of a DOM element or
component -->
<div [innertext]="textBox.value"></div>