Working with Directives and Pipes Presentation. Part 2

Содержание

Слайд 2

ABOUT MYSELF

Front-end developer
2 years
Angular 1.x
C# - ASP.NET MVC 3
Last project –

ABOUT MYSELF Front-end developer 2 years Angular 1.x C# - ASP.NET MVC
trading system (Angular 1, WebSockets, React, SASS, Gulp …).

Слайд 3

What are Pipes on Angular 2
Use of Pipes
Build-in Pipes
Custom Pipes
Pure and Impure

What are Pipes on Angular 2 Use of Pipes Build-in Pipes Custom
Pipes
Async Pipe

LESSON PLAN

Слайд 4

Pipes allow us to change data inside of a template
JavaScript Angular2

WHAT

Pipes allow us to change data inside of a template JavaScript Angular2
ARE PIPES ON ANGULAR 2?

Слайд 5

General syntax(template)

{{ expression | pipeName:parameter1:parameter2 }}


Chaining Pipes

USING PIPES

General syntax(template) {{ expression | pipeName:parameter1:parameter2 }} Chaining Pipes USING PIPES

Слайд 6

USING PIPES

Using in code

USING PIPES Using in code

Слайд 7

USING PIPES

Using in code

USING PIPES Using in code

Слайд 8

DatePipe

BUILT-IN PIPES

DatePipe BUILT-IN PIPES

Слайд 9

BUILT-IN PIPES

SlicePipe

BUILT-IN PIPES SlicePipe

Слайд 10

BUILT-IN PIPES

BUILT-IN PIPES

Слайд 11

UpperCasePipe
LowerCasePipe

BUILT-IN PIPES

UpperCasePipe LowerCasePipe BUILT-IN PIPES

Слайд 12

CurrencyPipe

BUILT-IN PIPES

https://en.wikipedia.org/wiki/ISO_4217

CurrencyPipe BUILT-IN PIPES https://en.wikipedia.org/wiki/ISO_4217

Слайд 13

DecimalPipe

BUILT-IN PIPES

DecimalPipe BUILT-IN PIPES

Слайд 14

JsonPipe

BUILT-IN PIPES

JsonPipe BUILT-IN PIPES

Слайд 15

http://plnkr.co/edit/5AKKFMJXXJKYziWX7ODN?p=preview

CUSTOM PIPES

EXAMPLE

http://plnkr.co/edit/5AKKFMJXXJKYziWX7ODN?p=preview CUSTOM PIPES EXAMPLE

Слайд 16

How to make the custom pipe available everywhere

CUSTOM PIPES

How to make the custom pipe available everywhere CUSTOM PIPES

Слайд 17

PURE AND IMPURE PIPES

Pure Pipes Angular executes a pure pipe only when it

PURE AND IMPURE PIPES Pure Pipes Angular executes a pure pipe only
detects a pure change to the input value. A pure change is either a change to a primitive input value (String, Number, Boolean, Symbol) or a changed object reference (Date, Array, Function, Object).
Pipes are pure by default.

Слайд 18

Impure Pipes
Angular executes an impure pipe during every component change detection cycle.

Impure Pipes Angular executes an impure pipe during every component change detection
An impure pipe will be called a lot, as often as every keystroke or mouse-move.

PURE AND IMPURE PIPES

Слайд 19

EXAMPLE

http://plnkr.co/edit/08HH8qArwZjOHqhGqXGK?p=preview

http://plnkr.co/edit/fJyipEbImeYypCFAPoiz?p=preview

EXAMPLE http://plnkr.co/edit/08HH8qArwZjOHqhGqXGK?p=preview http://plnkr.co/edit/fJyipEbImeYypCFAPoiz?p=preview

Слайд 20

ASYNC PIPE

EXAMPLE

http://plnkr.co/edit/9ICJ20kzzsHvwbrNS2Lk?p=preview

ASYNC PIPE EXAMPLE http://plnkr.co/edit/9ICJ20kzzsHvwbrNS2Lk?p=preview

Слайд 21

HTML SANITAZE PIPE

HTML SANITAZE PIPE

Слайд 22

https://www.ng-book.com/2/
https://angular.io/docs/ts/latest/api/#!?apiFilter=pipe
https://angular.io/docs/ts/latest/guide/pipes.html
http://stackoverflow.com/questions/34456430/ngfor-doesnt-update-data-with-pipe-in-angular2

USEFUL LINKS

https://www.ng-book.com/2/ https://angular.io/docs/ts/latest/api/#!?apiFilter=pipe https://angular.io/docs/ts/latest/guide/pipes.html http://stackoverflow.com/questions/34456430/ngfor-doesnt-update-data-with-pipe-in-angular2 USEFUL LINKS
Имя файла: Working-with-Directives-and-Pipes-Presentation.-Part-2.pptx
Количество просмотров: 41
Количество скачиваний: 0