SlideShare a Scribd company logo
Angular 5
has arrived…
Bartłomiej Narożnik
Bartłomiej Narożnik - Angular 5 2
Patch: 4.4.6
- No Features, No Breaking Changes
Minor: 4.4.0
- New Features, No Breaking Changes
Major: 5.0.0
- New Features, Potential Breaking Changes
Bartłomiej Narożnik - Angular 5 3
1. Marking parts of your application as pure.
2. Removing angular decorators from runtime code.
Enabled by default for CLI production build.
--no-build-optimizer
Bartłomiej Narożnik - Angular 5 4
Angular compiler as a TypeScript transform (TS 2.3)
40% faster builds
(95% for angular.io 40s -> <2s)
ng serve –aot
Bartłomiej Narożnik - Angular 5 5
ServerTransferStateModule
BrowserTransferStateModule
Bartłomiej Narożnik - Angular 5 6
• Support more DOM manipulations out of the box within server
side contexts
• Improved support for 3rd party JS and Component libraries
that aren’t server-side aware
Bartłomiej Narożnik - Angular 5 7
@Component({
provider: [{provide: SOME_TOKEN, useFactory: () => null}]
})
export class MyComponent { }
@Component({
provider: [{provide: SOME_TOKEN, useValue: SomeEnum.OK}]
})
export class MyComponent { }
Bartłomiej Narożnik - Angular 5 8
//Before
ReflectiveInjector.resolveAndCreate(providers);
//After
Injector.create(providers);
Bartłomiej Narożnik - Angular 5 9
platformBrowserDynamic()
.bootstrapModule(
AppModule,
{ngZone: 'noop'})
.then( ref => {} );
Bartłomiej Narożnik - Angular 5 10
Bartłomiej Narożnik - Angular 5 11
fullTemplateTypeCheck option
<div>{{ 11.1 | lowercase }}</div>
-> Argument of type '11.1' is not assignable to parameter of type 'string'
<input [(ngModel)]="book.title" required #bookCtrl="ngModel">
<div *ngIf="bookCtrl.hasEror('required')">Title required</div>
-> Property 'hasEror' does not exist on type 'NgModel'. Did you mean 'hasError'?
Bartłomiej Narożnik - Angular 5 12
platformBrowserDynamic().bootstrapModule(AppModule, {
preserveWhitespaces: false
});
@Component({
selector: 'my',
templateUrl: './my.component.html',
preserveWhitespaces: false
})
export class MyComponent { ... }
Bartłomiej Narożnik - Angular 5 13
<div ngPreserveWhitespaces>
whitespaces preserved here
<span> and here </span>
</div>
<a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a>
<a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>
Bartłomiej Narożnik - Angular 5 14
• <pre> tags are not affected 
• Defaults to true… for now.
• Removes about 6% of generated code
Bartłomiej Narożnik - Angular 5 15
Bartłomiej Narożnik - Angular 5 16
• Typed Response body access
• JSON as default (no need to parse)
• Interceptors
• Immutable Request/Response
• Progress Events
• Better Unit Testing
Bartłomiej Narożnik - Angular 5 17
@angular/http module officially deprecated
replaced by @angular/common/http
HttpHeaders and HttpParams accept object literals
Bartłomiej Narożnik - Angular 5 18
// using classes
const headers = new HttpHeaders().set('X-Option', 'true');
http.get(url, { headers });
const params = new HttpParams().set('test', 'true');
http.get(url, { params });
// without classes
http.get(url, { headers: {'X-Option': 'true'} });
http.get(url, { params: {'test': 'true'} });
Bartłomiej Narożnik - Angular 5 19
Bartłomiej Narożnik - Angular 5 20
GuardsCheckStart, GuardsCheckEnd
ActivationStart, ActivationEnd
ResolveStart, ResolveEnd
ChildActivationStart, ChildActivationEnd
Bartłomiej Narożnik - Angular 5 21
class MyComponent {
constructor(public router: Router, spinner: Spinner) {
router.events.subscribe(e => {
if (e instanceof ChildActivationStart) {
spinner.start(e.route);
} else if (e instanceof ChildActivationEnd) {
spinner.end(e.route);
}
});
}
}
Bartłomiej Narożnik - Angular 5 22
@NgModule({
providers: [
RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload'
}
)
]
})
*Scheduled for 5.1
Bartłomiej Narożnik - Angular 5 23
Bartłomiej Narożnik - Angular 5 24
Caching
• static assets
• external resources
• route redirection
• dynamic content
Strategies
• freshness
• performance
Bartłomiej Narożnik - Angular 5 25
import { SwPush } from '@angular/service-worker';
subscribeToPush() {
// Requesting messaging service to subscribe current client (browser)
this.swPush
.requestSubscription({ serverPublicKey: this.VAPID_PUBLIC_KEY })
.then(pushSubscription => {
// Passing subscription object to our backend
this.pushService.addSubscriber(pushSubscription)
.subscribe(
res => {
console.log('[App] Add subscriber request answer', res);
}
);
});
}
Bartłomiej Narożnik - Angular 5 26
import { SwUpdate } from '@angular/service-worker';
this.swUpdate.checkForUpdate()
.then(() => {
console.log('[App] checkForUpdate completed')
})
this.swUpdate.activateUpdate()
.then(() => {
console.log('[App] activateUpdate completed')
this.winRef.nativeWindow.location.reload()
})
Bartłomiej Narożnik - Angular 5 28
• Angular now uses data from Common Locale Data Repository
(CLDR) instead.
• No need for intl polyfil
• Old pipes in DeprecatedI18NPipesModule
• Locale parameter in all i18n pipes
• Default locale en-US
Bartłomiej Narożnik - Angular 5 29
import {LOCALE_ID} from '@angular/core';
import {registerLocaleData} from '@angular/common';
import localePl from '@angular/common/locales/pl-PL';
registerLocaleData(localePl);
@NgModule({
...
providers: [
{ provide: LOCALE_ID, useValue: 'pl-PL' },
]
...
})
Bartłomiej Narożnik - Angular 5 30
• New formats (long, longDate, longTime, full, fullDate, fullTime)
• Timezone support
• Locale support
<!-- common usage using pre-defined format string -->
<span>{{ d | date: 'shortDate' }}</span> <!-- en-US: 1/18/17 -->
<!-- specific locale -->
<span>{{ d | date: 'shortDate': null: 'pl' }}</span> <!-- pl-PL: 18/1/17 -->
<!-- custom format string -->
<span>{{ d | date: 'M/d/yy': null: 'pl' }}</span> <!-- pl-PL: 18/1/17 -->
Bartłomiej Narożnik - Angular 5 31
Field type Format Example value v4 v5
Eras Narrow A for AD G GGGGG
Months Narrow S for September L MMMMM
Week day Narrow M for Monday E EEEEE
Timezone Long location
Pacific Standard
Time
z Not available
Timezone Long GMT GMT+01:00 Z ZZZZ
Bartłomiej Narożnik - Angular 5 32
Bartłomiej Narożnik - Angular 5 33
<input name="title" ngModel [ngModelOptions]="{updateOn: 'blur'}">
<form [ngFormOptions]="{updateOn: 'submit'}">
Bartłomiej Narożnik - Angular 5 34
new FormGroup(value, {updateOn: 'blur'}));
new FormControl(value, {updateOn: 'blur',
asyncValidators: [myValidator]})
Bartłomiej Narożnik - Angular 5 35
Bartłomiej Narożnik - Angular 5 36
animations: [
trigger('query', [
transition(
'* => start',
[
query(
'.item',
[style({ opacity: 0 }), animate('2s', style({ opacity: 1 }))],
{ limit: -3 }
),
]),
]),
]
Bartłomiej Narożnik - Angular 5 37
//Before
transition('0 => 1, 1 => 2, 2 => 3, 3 => 4', ...)
//After
transition(':increment')
Bartłomiej Narożnik - Angular 5 38
export const expandTypo = [
trigger('expandTypo', [
transition(':leave', [
animate('150ms cubic-bezier(0.4, 0.0, 1, 1)', style({
height: 0,
opacty: 0 // <-- typo here, could also be anything random
}))
])
])
];
Bartłomiej Narożnik - Angular 5 39
//Before
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/filter';
shortTitles = allBooks
.map(book => book.title)
.filter(title => title.length < 20);
//After
import { Observable } from 'rxjs/Observable';
import { map, filter } from 'rxjs/operators';
shortTitles = allBooks.pipe(
map(book => book.title),
filter(title => title.length < 20),
);
Bartłomiej Narożnik - Angular 5 40
• Weekly patch version
• Monthly minor version
• Major version every 6 months (backwards compatible)
• Almost 9000 commits in total
• ~9 commits per day (1932 commits between versions 4 and
5)
Bartłomiej Narożnik - Angular 5 41
Bartłomiej Narożnik - Angular 5 42
@bart_naroznik
Bartłomiej Narożnik - Angular 5 43
No matter
how impressive the lift-off
is,
it’s the landing that counts..

More Related Content

What's hot

Angular Dependency Injection
Angular Dependency InjectionAngular Dependency Injection
Angular Dependency Injection
Nir Kaufman
 
Data Flow Patterns in Angular 2 - Sebastian Müller
Data Flow Patterns in Angular 2 -  Sebastian MüllerData Flow Patterns in Angular 2 -  Sebastian Müller
Data Flow Patterns in Angular 2 - Sebastian Müller
Sebastian Holstein
 
Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2
Ahmed Moawad
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
Phan Tuan
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
Scott Lee
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
Yakov Fain
 
Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1
Ahmed Moawad
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
Naveen Pete
 
The productive developer guide to Angular 2
The productive developer guide to Angular 2The productive developer guide to Angular 2
The productive developer guide to Angular 2
Maurice De Beijer [MVP]
 
Angular2 intro
Angular2 introAngular2 intro
Angular2 intro
Shawn McKay
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0 Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
Sumanth Chinthagunta
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
Dor Moshe
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
Jesse Warden
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
Rohit Bishnoi
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
Katy Slemon
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
Katy Slemon
 
Quick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developersQuick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developers
Paweł Żurowski
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?
jbandi
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2IDeveloping a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
Nader Debbabi
 

What's hot (20)

Angular Dependency Injection
Angular Dependency InjectionAngular Dependency Injection
Angular Dependency Injection
 
Data Flow Patterns in Angular 2 - Sebastian Müller
Data Flow Patterns in Angular 2 -  Sebastian MüllerData Flow Patterns in Angular 2 -  Sebastian Müller
Data Flow Patterns in Angular 2 - Sebastian Müller
 
Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2Exploring Angular 2 - Episode 2
Exploring Angular 2 - Episode 2
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Angular 4 Introduction Tutorial
Angular 4 Introduction TutorialAngular 4 Introduction Tutorial
Angular 4 Introduction Tutorial
 
Overview of the AngularJS framework
Overview of the AngularJS framework Overview of the AngularJS framework
Overview of the AngularJS framework
 
Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1Exploring Angular 2 - Episode 1
Exploring Angular 2 - Episode 1
 
Introduction to Angular 2
Introduction to Angular 2Introduction to Angular 2
Introduction to Angular 2
 
The productive developer guide to Angular 2
The productive developer guide to Angular 2The productive developer guide to Angular 2
The productive developer guide to Angular 2
 
Angular2 intro
Angular2 introAngular2 intro
Angular2 intro
 
Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0 Single Page Applications with AngularJS 2.0
Single Page Applications with AngularJS 2.0
 
Introduction to angular 2
Introduction to angular 2Introduction to angular 2
Introduction to angular 2
 
Angular 2 overview
Angular 2 overviewAngular 2 overview
Angular 2 overview
 
Angular2 with TypeScript
Angular2 with TypeScript Angular2 with TypeScript
Angular2 with TypeScript
 
Top 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular AppTop 7 Angular Best Practices to Organize Your Angular App
Top 7 Angular Best Practices to Organize Your Angular App
 
An Overview of Angular 4
An Overview of Angular 4 An Overview of Angular 4
An Overview of Angular 4
 
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
How to Implement Basic Angular Routing and Nested Routing With Params in Angu...
 
Quick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developersQuick introduction to Angular 4 for AngularJS 1.5 developers
Quick introduction to Angular 4 for AngularJS 1.5 developers
 
Angular 2: What's New?
Angular 2: What's New?Angular 2: What's New?
Angular 2: What's New?
 
Developing a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2IDeveloping a Demo Application with Angular 4 - J2I
Developing a Demo Application with Angular 4 - J2I
 

Similar to Angular 5

Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...
Paweł Żurowski
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
Luciano Mammino
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
OdessaJS Conf
 
Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)
Kasper Reijnders
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Fwdays
 
Angular 2 Unit Testing.pptx
Angular 2 Unit Testing.pptxAngular 2 Unit Testing.pptx
Angular 2 Unit Testing.pptx
accordv12
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
Ignacio Martín
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Yoann Gotthilf
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
Loiane Groner
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
Coding Academy
 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
Alessandro Molina
 
Building a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesBuilding a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web Services
David Giard
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
Maurizio Vitale
 
Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.
Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.
Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.
VitaliyMakogon
 
Assurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkAssurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring framework
Gosuke Miyashita
 
はじめてのAngular2
はじめてのAngular2はじめてのAngular2
はじめてのAngular2
Kenichi Kanai
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
أحمد عبد الوهاب
 
2016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES62016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES6
양재동 코드랩
 
[W3C HTML5 2016] Angular + ES6
[W3C HTML5 2016] Angular + ES6[W3C HTML5 2016] Angular + ES6
[W3C HTML5 2016] Angular + ES6
양재동 코드랩
 
Angular 1 + es6
Angular 1 + es6Angular 1 + es6
Angular 1 + es6
장현 한
 

Similar to Angular 5 (20)

Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...Architecture for scalable Angular applications (with introduction and extende...
Architecture for scalable Angular applications (with introduction and extende...
 
How to send gzipped requests with boto3
How to send gzipped requests with boto3How to send gzipped requests with boto3
How to send gzipped requests with boto3
 
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
Maciej Treder ''Angular Universal - a medicine for the Angular + SEO/CDN issu...
 
Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)Jan 2017 - a web of applications (angular 2)
Jan 2017 - a web of applications (angular 2)
 
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
Maciej Treder "Server-side rendering with Angular—be faster and more SEO, CDN...
 
Angular 2 Unit Testing.pptx
Angular 2 Unit Testing.pptxAngular 2 Unit Testing.pptx
Angular 2 Unit Testing.pptx
 
Server side rendering with React and Symfony
Server side rendering with React and SymfonyServer side rendering with React and Symfony
Server side rendering with React and Symfony
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Serverless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applicationsServerless Angular, Material, Firebase and Google Cloud applications
Serverless Angular, Material, Firebase and Google Cloud applications
 
Angular 16 – the rise of Signals
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
 
Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2Reactive & Realtime Web Applications with TurboGears2
Reactive & Realtime Web Applications with TurboGears2
 
Building a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web ServicesBuilding a TV show with Angular, Bootstrap, and Web Services
Building a TV show with Angular, Bootstrap, and Web Services
 
How to create an Angular builder
How to create an Angular builderHow to create an Angular builder
How to create an Angular builder
 
Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.
Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.
Vitaliy Makogon: Migration to ivy. Angular component libraries with IVY support.
 
Assurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring frameworkAssurer - a pluggable server testing/monitoring framework
Assurer - a pluggable server testing/monitoring framework
 
はじめてのAngular2
はじめてのAngular2はじめてのAngular2
はじめてのAngular2
 
Angular Js Basics
Angular Js BasicsAngular Js Basics
Angular Js Basics
 
2016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES62016 W3C Conference #4 : ANGULAR + ES6
2016 W3C Conference #4 : ANGULAR + ES6
 
[W3C HTML5 2016] Angular + ES6
[W3C HTML5 2016] Angular + ES6[W3C HTML5 2016] Angular + ES6
[W3C HTML5 2016] Angular + ES6
 
Angular 1 + es6
Angular 1 + es6Angular 1 + es6
Angular 1 + es6
 

Recently uploaded

E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
Hornet Dynamics
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
lorraineandreiamcidl
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Envertis Software Solutions
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
TheSMSPoint
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
Yara Milbes
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 

Recently uploaded (20)

E-commerce Application Development Company.pdf
E-commerce Application Development Company.pdfE-commerce Application Development Company.pdf
E-commerce Application Development Company.pdf
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptxLORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
LORRAINE ANDREI_LEQUIGAN_HOW TO USE WHATSAPP.pptx
 
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise EditionWhy Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
Why Choose Odoo 17 Community & How it differs from Odoo 17 Enterprise Edition
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
Transform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR SolutionsTransform Your Communication with Cloud-Based IVR Solutions
Transform Your Communication with Cloud-Based IVR Solutions
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
SMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API ServiceSMS API Integration in Saudi Arabia| Best SMS API Service
SMS API Integration in Saudi Arabia| Best SMS API Service
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 

Angular 5

  • 2. Bartłomiej Narożnik - Angular 5 2 Patch: 4.4.6 - No Features, No Breaking Changes Minor: 4.4.0 - New Features, No Breaking Changes Major: 5.0.0 - New Features, Potential Breaking Changes
  • 3. Bartłomiej Narożnik - Angular 5 3 1. Marking parts of your application as pure. 2. Removing angular decorators from runtime code. Enabled by default for CLI production build. --no-build-optimizer
  • 4. Bartłomiej Narożnik - Angular 5 4 Angular compiler as a TypeScript transform (TS 2.3) 40% faster builds (95% for angular.io 40s -> <2s) ng serve –aot
  • 5. Bartłomiej Narożnik - Angular 5 5 ServerTransferStateModule BrowserTransferStateModule
  • 6. Bartłomiej Narożnik - Angular 5 6 • Support more DOM manipulations out of the box within server side contexts • Improved support for 3rd party JS and Component libraries that aren’t server-side aware
  • 7. Bartłomiej Narożnik - Angular 5 7 @Component({ provider: [{provide: SOME_TOKEN, useFactory: () => null}] }) export class MyComponent { } @Component({ provider: [{provide: SOME_TOKEN, useValue: SomeEnum.OK}] }) export class MyComponent { }
  • 8. Bartłomiej Narożnik - Angular 5 8 //Before ReflectiveInjector.resolveAndCreate(providers); //After Injector.create(providers);
  • 9. Bartłomiej Narożnik - Angular 5 9 platformBrowserDynamic() .bootstrapModule( AppModule, {ngZone: 'noop'}) .then( ref => {} );
  • 10. Bartłomiej Narożnik - Angular 5 10
  • 11. Bartłomiej Narożnik - Angular 5 11 fullTemplateTypeCheck option <div>{{ 11.1 | lowercase }}</div> -> Argument of type '11.1' is not assignable to parameter of type 'string' <input [(ngModel)]="book.title" required #bookCtrl="ngModel"> <div *ngIf="bookCtrl.hasEror('required')">Title required</div> -> Property 'hasEror' does not exist on type 'NgModel'. Did you mean 'hasError'?
  • 12. Bartłomiej Narożnik - Angular 5 12 platformBrowserDynamic().bootstrapModule(AppModule, { preserveWhitespaces: false }); @Component({ selector: 'my', templateUrl: './my.component.html', preserveWhitespaces: false }) export class MyComponent { ... }
  • 13. Bartłomiej Narożnik - Angular 5 13 <div ngPreserveWhitespaces> whitespaces preserved here <span> and here </span> </div> <a>Spaces</a>&ngsp;<a>between</a>&ngsp;<a>links.</a> <a>before</a>&ngsp;&ngsp;&ngsp;<a>after</a>
  • 14. Bartłomiej Narożnik - Angular 5 14 • <pre> tags are not affected  • Defaults to true… for now. • Removes about 6% of generated code
  • 15. Bartłomiej Narożnik - Angular 5 15
  • 16. Bartłomiej Narożnik - Angular 5 16 • Typed Response body access • JSON as default (no need to parse) • Interceptors • Immutable Request/Response • Progress Events • Better Unit Testing
  • 17. Bartłomiej Narożnik - Angular 5 17 @angular/http module officially deprecated replaced by @angular/common/http HttpHeaders and HttpParams accept object literals
  • 18. Bartłomiej Narożnik - Angular 5 18 // using classes const headers = new HttpHeaders().set('X-Option', 'true'); http.get(url, { headers }); const params = new HttpParams().set('test', 'true'); http.get(url, { params }); // without classes http.get(url, { headers: {'X-Option': 'true'} }); http.get(url, { params: {'test': 'true'} });
  • 19. Bartłomiej Narożnik - Angular 5 19
  • 20. Bartłomiej Narożnik - Angular 5 20 GuardsCheckStart, GuardsCheckEnd ActivationStart, ActivationEnd ResolveStart, ResolveEnd ChildActivationStart, ChildActivationEnd
  • 21. Bartłomiej Narożnik - Angular 5 21 class MyComponent { constructor(public router: Router, spinner: Spinner) { router.events.subscribe(e => { if (e instanceof ChildActivationStart) { spinner.start(e.route); } else if (e instanceof ChildActivationEnd) { spinner.end(e.route); } }); } }
  • 22. Bartłomiej Narożnik - Angular 5 22 @NgModule({ providers: [ RouterModule.forRoot(routes, { onSameUrlNavigation: 'reload' } ) ] }) *Scheduled for 5.1
  • 23. Bartłomiej Narożnik - Angular 5 23
  • 24. Bartłomiej Narożnik - Angular 5 24 Caching • static assets • external resources • route redirection • dynamic content Strategies • freshness • performance
  • 25. Bartłomiej Narożnik - Angular 5 25 import { SwPush } from '@angular/service-worker'; subscribeToPush() { // Requesting messaging service to subscribe current client (browser) this.swPush .requestSubscription({ serverPublicKey: this.VAPID_PUBLIC_KEY }) .then(pushSubscription => { // Passing subscription object to our backend this.pushService.addSubscriber(pushSubscription) .subscribe( res => { console.log('[App] Add subscriber request answer', res); } ); }); }
  • 26. Bartłomiej Narożnik - Angular 5 26 import { SwUpdate } from '@angular/service-worker'; this.swUpdate.checkForUpdate() .then(() => { console.log('[App] checkForUpdate completed') }) this.swUpdate.activateUpdate() .then(() => { console.log('[App] activateUpdate completed') this.winRef.nativeWindow.location.reload() })
  • 27.
  • 28. Bartłomiej Narożnik - Angular 5 28 • Angular now uses data from Common Locale Data Repository (CLDR) instead. • No need for intl polyfil • Old pipes in DeprecatedI18NPipesModule • Locale parameter in all i18n pipes • Default locale en-US
  • 29. Bartłomiej Narożnik - Angular 5 29 import {LOCALE_ID} from '@angular/core'; import {registerLocaleData} from '@angular/common'; import localePl from '@angular/common/locales/pl-PL'; registerLocaleData(localePl); @NgModule({ ... providers: [ { provide: LOCALE_ID, useValue: 'pl-PL' }, ] ... })
  • 30. Bartłomiej Narożnik - Angular 5 30 • New formats (long, longDate, longTime, full, fullDate, fullTime) • Timezone support • Locale support <!-- common usage using pre-defined format string --> <span>{{ d | date: 'shortDate' }}</span> <!-- en-US: 1/18/17 --> <!-- specific locale --> <span>{{ d | date: 'shortDate': null: 'pl' }}</span> <!-- pl-PL: 18/1/17 --> <!-- custom format string --> <span>{{ d | date: 'M/d/yy': null: 'pl' }}</span> <!-- pl-PL: 18/1/17 -->
  • 31. Bartłomiej Narożnik - Angular 5 31 Field type Format Example value v4 v5 Eras Narrow A for AD G GGGGG Months Narrow S for September L MMMMM Week day Narrow M for Monday E EEEEE Timezone Long location Pacific Standard Time z Not available Timezone Long GMT GMT+01:00 Z ZZZZ
  • 32. Bartłomiej Narożnik - Angular 5 32
  • 33. Bartłomiej Narożnik - Angular 5 33 <input name="title" ngModel [ngModelOptions]="{updateOn: 'blur'}"> <form [ngFormOptions]="{updateOn: 'submit'}">
  • 34. Bartłomiej Narożnik - Angular 5 34 new FormGroup(value, {updateOn: 'blur'})); new FormControl(value, {updateOn: 'blur', asyncValidators: [myValidator]})
  • 35. Bartłomiej Narożnik - Angular 5 35
  • 36. Bartłomiej Narożnik - Angular 5 36 animations: [ trigger('query', [ transition( '* => start', [ query( '.item', [style({ opacity: 0 }), animate('2s', style({ opacity: 1 }))], { limit: -3 } ), ]), ]), ]
  • 37. Bartłomiej Narożnik - Angular 5 37 //Before transition('0 => 1, 1 => 2, 2 => 3, 3 => 4', ...) //After transition(':increment')
  • 38. Bartłomiej Narożnik - Angular 5 38 export const expandTypo = [ trigger('expandTypo', [ transition(':leave', [ animate('150ms cubic-bezier(0.4, 0.0, 1, 1)', style({ height: 0, opacty: 0 // <-- typo here, could also be anything random })) ]) ]) ];
  • 39. Bartłomiej Narożnik - Angular 5 39 //Before import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/filter'; shortTitles = allBooks .map(book => book.title) .filter(title => title.length < 20); //After import { Observable } from 'rxjs/Observable'; import { map, filter } from 'rxjs/operators'; shortTitles = allBooks.pipe( map(book => book.title), filter(title => title.length < 20), );
  • 40. Bartłomiej Narożnik - Angular 5 40 • Weekly patch version • Monthly minor version • Major version every 6 months (backwards compatible) • Almost 9000 commits in total • ~9 commits per day (1932 commits between versions 4 and 5)
  • 41. Bartłomiej Narożnik - Angular 5 41
  • 42. Bartłomiej Narożnik - Angular 5 42
  • 43. @bart_naroznik Bartłomiej Narożnik - Angular 5 43 No matter how impressive the lift-off is, it’s the landing that counts..

Editor's Notes

  1. During the Tree Shake portion of the AOT compilation, the application’s dependency graph is walked to determine what parts of the JavaScript code are unused. Thus, if a pure function’s result isn’t used, the function may be safely removed. Because Decorators are consumed during the compilation process, after compilation, they may be removed to reduce code size.
  2. TypeScript transforms were a new feature introduced as part of TypeScript 2.3 that allows to hook into the standard TypeScript compilation pipeline. You can take advantage of this by running ng serve with the AOT flag turned on. This will become the default in a future release of the CLI. There are some known speed issues with projects with more than a thousand components. Angular team wants to be sure projects of all sizes will experience these improvements. It’s a CLI feature so can be turned on independently.
  3. Angular Universal is a project focused on helping developers to perform server side rendering (SSR) of Angular applications. By rendering on the server and then bootstrapping on top of the generated HTML, you can add support for scrapers and crawlers that don’t support JavaScript, and you increase the perceived performance of your application. ServerTransferStateModule and BrowserTransferStateModule allows to generate information as part of rendering with platform-server, and then transfer to the client side. So that this information does not need to be regenerated. Useful for cases such as when your application fetches data over HTTP. By transferring state from the server, this means developers do not need to make a second HTTP request once the application makes it to the client. Documentation for state transfer is forthcoming in the next few weeks.
  4. Angular Universal platform-server now works with Domino
  5. Expression lowering in decorators for lambdas and the value of useValue, useFactory and data in object literals Allows to use values that can only be calculated at runtime in decorators for expressions that are lowered. Lambda can be used instead of a named function
  6. Static injector no longer requires the Reflect polyfill, reducing application size for most developers.
  7. Zones are used to automatically trigger change detections as a result of asynchronous operations. Change detection is a separate mechanism – can work without zones. Zones are faster by default, but it’s now possible to bypass zones for performance focused applications.
  8. It can for example catch that a pipe is not used with the proper type. It can also analyze the local variables referencing a directive in your templates. Right now the default value of fullTemplateTypeCheck is false, but we can expect to see it become true in a future release. (Side note: this feature is currently a bit flaky, and I ran into issues testing it. You might want to wait 5.0.x to try it!).
  9. Angular 4.4.1 (September 18th)
  10. Introduced in 4.3 Typed, synchronous response body access, including support for JSON body types JSON is an assumed default and no longer needs to be explicitly parsed Interceptors allow middleware logic to be inserted into the pipeline Immutable request/response objects Progress events for both request upload and response download Post-request verification & flush based testing framework
  11. An example of using these events to start/stop a spinner
  12. It’s now possible to reload a page when the router receives a request to navigate to the same URL. Until now it was ignoring such a request, making it impossible to build a “refresh” button. It’s now configurable at the router level, using onSameUrlNavigation, which can receive either reload or ignore (currently the default).
  13. No support in CLI yet. Planned for 1.6.
  14. cache your static assets by default. download only what has changed when you deploy a new version, allowing blazingly fast application start! it can go further, allowing to cache external resources (like fonts, icons from a CDN…), route redirection and even dynamic content caching (like calls to your API), with different strategies possible (always fetch for fresh data, or always serve from cache for speed…). Really smart network optimizations, requiring only some JSON configuration from us. No support in CLI yet. Planned for 1.6.
  15. We can subscribe to push notification as well as send them. No support in CLI yet. Planned for 1.6.
  16. download only what has changed when you deploy a new version, allowing blazingly fast application start! The user workflow should not be interrupted by the unexpectedly updated application. The app version in the opened browser tab will remain the same until the tab close. NGSW should keep app integrity. If any single file in application distributive was updated, we treat the whole corresponding version as a new one.
  17. The Intl API from @angular/common has been removed to improve browser support. Intl API is not needed anymore, we extract and use data from Common Locale Data Repository (CLDR) instead. 
  18. The Intl API from @angular/common has been removed to improve browser support. Intl API is not needed anymore, we extract and use data from Common Locale Data Repository (CLDR) instead. 
  19. Animation queries now support negative limits, in which case will be matching elements from the end rather than from the beginning. Here’s an example showing limiting the last 3 elements with class “item”:
  20. Let’s say you want to animate a carousel with 5 elements, with a nice animation based on the index of the element displayed. You had to declare a transition like: transition('0 => 1, 1 => 2, 2 => 3, 3 => 4', ...). With Angular 5, you can now use transition(':increment')!
  21. These new operators eliminate the side effects and the code splitting / tree shaking problems that existed with the previous ‘patch’ method of importing operators.
  22. Over 500 contriubutors 2 big companies