2. Components
“A component controls a patch of screen real estate that we could call a view,
and
declares reusable UI building blocks for an application.”
Babel Coder
24. Pipes
Use pipes to transform strings, currency amounts, dates, and other data for display. Pipes are
simple functions to use in template expressions to accept an input value and return a
transformed value.
Babel Coder
33. Services (Consumer)
Injector
Service A Service B Service C Service D
Component
constructor(private serviceA: ServiceA) {}
Babel Coder
private serviceA = inject(ServiceA)
Component
34. Services (Consumer)
Injector
Service B Service C Service D
Babel Coder
private serviceA = inject(ServiceA)
Component
Injector
Service B Service C Service D
Service A
resolves
37. let a = 1
let b = 2
let c = a + b // 3
a = 4
c = 3
c = 6
Babel Coder
38. reactive programming
Reactive programming is a programming paradigm oriented around data flows
and the propagation of change
let a
let b
let c
1
2
3
4
5
3 7 9
Babel Coder
40. reactive programming
1 Define the different streams
2 Define the operations
+
let a
let b
let c
1
2
3
4
5
3 7 9
Babel Coder
41. reactive programming
It allows you to specify the dynamic behavior of a value completely at the time of
creation.
let a = 1
let b = 2
console.log(a * 2)
console.log(b * 2)
IMP
let values$ = of(1, 2);
let transform$ = values$.pipe(map(a => a * 2));
transform$.subscribe(
value => console.log(value)
);
RP
Babel Coder
46. observable
Observables act as a blueprint for how we want to create streams,
subscribe to them, react to new values,
and combine streams together to build new ones.
Observer Observable
Stream
Babel Coder
47. marble diagrams
let streamA$ = interval(1000);
let streamB$ = streamA$.pipe(map(a => a * 2));
streamB$.subscribe(console.log); 0
2
4
6
…
50. marble diagrams
let streamA$ = interval(1000);
let streamB$ = streamA$.pipe(map(a => a * 2));
/*
streamA: ---0---1---2---3---4...
map(a => 2 * a)
streamB: ---0---2---4---6---8...
*/
streamB$.subscribe(value => console.log(value)); Babel Coder
51. reactive programming
It allows you to specify the dynamic behavior of a value completely at the time of
creation.
let a = 1
let b = 2
console.log(a * 2)
console.log(b * 2)
IMP
let values$ = of(1, 2);
let transform$ = values$.pipe(map(a => a * 2));
transform$.subscribe(
value => console.log(value)
);
RP
Babel Coder
80. REST
Stands for “Representational State Transfer”
RESTful Web Services are one way of providing
interoperability between computer systems on the Internet.
Babel Coder
86. HTTP Status Codes
CODE STATUS
1xx Informational responses
2xx Success
3xx Redirection
4xx Client Errors
5xx Server Errors
87. HTTP Status Codes
CODE STATUS
200 OK
201 Created
204 No Content
401 Unauthorized
404 Not Found
405 Method Not Allowed
422 Unprocessable Entity
500 Internal Server Error
89. Authentication & authorization
Authentication is the process of ascertaining that
somebody really is who he claims to be.
Authorization refers to rules that determine who is
allowed to do what.
Babel Coder
93. JSON Web Token
JSON Web Token (JWT) is a JSON-based open standard (RFC 7519) for creating access tokens that
assert some number of claims.
<HEADER>.<PAYLOAD>.<SIGNATURE>
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJtZXNzYWdlIjoiSldUIFJ1bGVzISIsImlhdCI6MTQ1OTQ0ODExOSwiZXhwIjoxNDU5NDU0NTE5fQ.-yIVBD5b73C75osbmwwshQ
Babel Coder