Slide 1

Slide 1 text

ngular with Minko Gechev github.com/mgechev twitter.com/mgechev blog.mgechev.com as Integrated Development Platform

Slide 2

Slide 2 text

Our Sponsor

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

Inspirational thought about programming Agenda

Slide 7

Slide 7 text

What is Angular

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

core (zones, di, abstractions, etc.)

Slide 12

Slide 12 text

renderer core (zones, di, abstractions, etc.)

Slide 13

Slide 13 text

compiler renderer core (zones, di, abstractions, etc.)

Slide 14

Slide 14 text

http compiler renderer core (zones, di, abstractions, etc.)

Slide 15

Slide 15 text

forms http compiler renderer core (zones, di, abstractions, etc.)

Slide 16

Slide 16 text

forms http compiler renderer core (zones, di, abstractions, etc.) router

Slide 17

Slide 17 text

forms http compiler renderer core (zones, di, abstractions, etc.) router i18n

Slide 18

Slide 18 text

forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade

Slide 19

Slide 19 text

forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 20

Slide 20 text

PWA forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 21

Slide 21 text

Universal PWA forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 22

Slide 22 text

material 2 Universal PWA forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 23

Slide 23 text

CLI material 2 Universal PWA forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 24

Slide 24 text

language services CLI material 2 Universal PWA forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 25

Slide 25 text

angularfire2 language services CLI material 2 Universal PWA forms http compiler renderer core (zones, di, abstractions, etc.) router i18n ngUpgrade animations

Slide 26

Slide 26 text

Integrated Development Platform

Slide 27

Slide 27 text

on the other hand…

Slide 28

Slide 28 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 29

Slide 29 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 30

Slide 30 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 31

Slide 31 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 32

Slide 32 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 33

Slide 33 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 34

Slide 34 text

• Angular’s AoT compiler • TypeScript compiler • Testing • Unit testing • e2e testing • Coverage • Module loader • Bundler • Provides bundling and tree shaking • Linter • TypeScript and CSS • Minifier • Minification & deadcode elimination • Service workers management/generation Angular Tooling

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

No content

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

angular-cli

Slide 45

Slide 45 text

ng new hello-world

Slide 46

Slide 46 text

angular-cli • Quick bootstrap of projects • Generating: • Components • Services • Directives • Pipes • Support for progressive apps • Codelyzer • many others…

Slide 47

Slide 47 text

angular-seed

Slide 48

Slide 48 text

git clone https://github.com/mgechev/angular-seed

Slide 49

Slide 49 text

angular-seed • TypeScript transpilation • Statically typed dev and prod builds • Extensible task configuration • Out of the box unit-testing • Test coverage • e2e testing with protractor • Codeyzer

Slide 50

Slide 50 text

Angular’s Core

Slide 51

Slide 51 text

@Component({ selector: 'toggle-button', template: '{{on}}', styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 52

Slide 52 text

@Component({ selector: 'toggle-button', template: '{{on}}', styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 53

Slide 53 text

@Component({ selector: 'toggle-button', template: '{{on}}', styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 54

Slide 54 text

@Component({ selector: 'toggle-button', template: '{{on}}', styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 55

Slide 55 text

Renderer

Slide 56

Slide 56 text

“A set of abstract operations which can be specialized for a specific platform”

Slide 57

Slide 57 text

“A set of abstract operations which can be specialized for a specific platform”

Slide 58

Slide 58 text

Angular is platform agnostic

Slide 59

Slide 59 text

No content

Slide 60

Slide 60 text

“NativeScript 2.0 truly native mobile apps”

Slide 61

Slide 61 text

“NativeScript 2.0 truly native mobile apps”

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

Server-side rendering

Slide 64

Slide 64 text

@Component({ selector: 'toggle-button', template: '{{on}}', styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 65

Slide 65 text

@Component({ selector: 'toggle-button', template: '{{on}}’, styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 66

Slide 66 text

@Component({ selector: 'toggle-button', template: '{{on}}', styles: ['button { width: 300px; }'] }) class ToggleButtonComponent { @ViewChild('btn') button; private on = false; constructor(private r: Renderer) {} toggle() { this.on = !this.on; this.on && this.r.setStyle(this.button, 'opacity', 1); !this.on && this.r.setStyle(this.button, 'opacity', 0.2); } } Pseudo code

Slide 67

Slide 67 text

Compiler

Slide 68

Slide 68 text

ToggleButtonComponent Compilation

Slide 69

Slide 69 text

ToggleButtonComponent Compiler Compilation

Slide 70

Slide 70 text

ToggleButtonComponent Compiler InternalComponent Compilation

Slide 71

Slide 71 text

Pseudo code class InternalComponent { create() { this.btn = this.renderer.createElement('button'); this.localOn = this.context.on; this.renderer.setText(this.btn, this.localOn); } detectChanges() { if (this.localOn !== this.context.on) { this.localOn = this.context.on; this.renderer.setText(this.btn, this.localOn); } } }

Slide 72

Slide 72 text

Pseudo code class InternalComponent { create() { this.btn = this.renderer.createElement('button'); this.localOn = this.context.on; this.renderer.setText(this.btn, this.localOn); } detectChanges() { if (this.localOn !== this.context.on) { this.localOn = this.context.on; this.renderer.setText(this.btn, this.localOn); } } }

Slide 73

Slide 73 text

Pseudo code class InternalComponent { create() { this.btn = this.renderer.createElement('button'); this.localOn = this.context.on; this.renderer.setText(this.btn, this.localOn); } detectChanges() { if (this.localOn !== this.context.on) { this.localOn = this.context.on; this.renderer.setText(this.btn, this.localOn); } } }

Slide 74

Slide 74 text

Transpiles an Angular application and performs a set of transformations, producing highly optimized VM friendly output Compiler

Slide 75

Slide 75 text

Compiler works runtime and build time

Slide 76

Slide 76 text

ng new hello-world --mobile

Slide 77

Slide 77 text

angular/mobile-toolkit

Slide 78

Slide 78 text

Progressive enhancement for web applications

Slide 79

Slide 79 text

mobile-toolkit • Offline access to static content • Notifications for new versions • Efficient download of deltas • Support of push notifications • AppShell

Slide 80

Slide 80 text

Still immature…

Slide 81

Slide 81 text

Development experience

Slide 82

Slide 82 text

Typical JavaScript experience

Slide 83

Slide 83 text

Angular is… • Built with TypeScript • Compile-time type checking • Great IDE/text editors support • Analyzable templates

Slide 84

Slide 84 text

Type-checking and IntelliSense in templates

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

Already supported by some IDEs

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

Using style guide in your project

Slide 92

Slide 92 text

Enforcing common style

Slide 93

Slide 93 text

• Fork the official style guide • Modify the styles according to your needs • Introduce the style guide to your team • Verify that each individual code change follows it Enforcing common style

Slide 94

Slide 94 text

• Fork the official style guide • Modify the styles according to your needs • Introduce the style guide to your team • Verify that each individual code change follows it Enforcing common style

Slide 95

Slide 95 text

• Fork the official style guide • Modify the styles according to your needs • Introduce the style guide to your team • Verify that each individual code change follows it Enforcing common style

Slide 96

Slide 96 text

Code review process

Slide 97

Slide 97 text

No content

Slide 98

Slide 98 text

manual boring error-prone

Slide 99

Slide 99 text

codelyzer

Slide 100

Slide 100 text

“codelyzer is a project which aims to enforce common style and verify correctness of your program”

Slide 101

Slide 101 text

No content

Slide 102

Slide 102 text

Recap • Angular as development platform • Angular CLI and angular-seed • Core • Mobile toolkit • Development experience

Slide 103

Slide 103 text

Resources • angular.io • github.com/angular/angular • github.com/angular/mobile-toolkit • github.com/angular/angular-cli • github.com/mgechev/angular-seed

Slide 104

Slide 104 text

Thank you! github.com/mgechev twitter.com/mgechev blog.mgechev.com