Training - Angular
Last Updated on: November 21, 2021 am
Angular
Binding within HTML Template
{{}}
string interpolation (within HTML template)
()
one-way event binding OUT of a component
[]
one-way attribute binding INTO a component
[()]
Two-way binding (used for forms)
1 |
|
1 |
|
Custom Events
All httpClient services are OBSERVABLE
1 |
|
A recommend way is to define the key-value pairs in the reportData
- easy for the service to call and html to get & show - is to define a Class
And treat the Class as an *Interface
Old way
Every time typing a letter into the search engine - send a request object to the back end - and send the response - then destroy. - really expensive
Now
Every time make a key stroke - one simple observable says: something happened and I’ll handle it. Then observable sends request to the server and come back with the answer. Here’s the response to that most recent change, and the same observable then sits there - as an observable - and any subscriber to that observable will be told about the change and response
Observable
Observable is an object that encapsulated an async request. you make the async request (e.g. http request to the server REST endpoints) and the call immediately returns the Observable object. We can subscribe to the Observable with a function that is called when the response comes back later.
Production and Deployment
ng build --configuration
To avoid name conflict with cache