#Angular This best way to learn something is to reorganise it and then teach it
##This repository holds my AngularJs 2 experiments codes angular-tour-of-hero is an introductory level experiment of AngularJs 2, which discovers core fundamentals of AngularJs 2. The rest of experiments goes into different parts of Angular in details.
- Templates
- Directives
- Components
- Multiple Components
- Services
- Routings
- Http
These are the the core fundamentals of AngularJs 2.
We can use built-in directives to show/hide elements and display lists of hero data. We can create a component to display hero details and another to show an array of heroes. We can use one-way data binding for read-only data. We can add editable fields to update a model with two-way data binding. We can bind component methods to user events like key strokes and clicks. We can select a hero from a master list and edit that hero in the details view. We can format data with pipes. We can create a shared service to assemble our heroes. And we can use routing to navigate among different views and their components.
This experiment covers a lot of ground at an introductory level but other experiment will take us in greater depth.
A form creates a cohesive, effective, and compelling data entry experience. An Angular form coordinates a set of data-bound user controls, tracks changes, validates input, and presents errors.Initial goal of this experiment is to cover the following Angular form topics:
- build an Angular form with a component and template
- two-way data bind with
[(ngModel)]
syntax for reading and writing values to input controls - track the change state and validity of form controls using
ngModel
in combination with a form - provide strong visual feedback using special CSS classes that track the state of the controls
- display validation errors to users and enable/disable form controls
- use template reference variables for sharing information among HTML elements
- States and transitions in
ConfigFormComponent
,TypeFormComponet
andTreatmentFormComponet
. - Entering and leaving in
TreatmentFormComponet
. - Automatic property calculation.
- Animation timing in
ConfigFormComponent
,TypeFormComponet
andTreatmentFormComponet
. - Parallel animation groups in
TreatmentFormComponet
.
- Pass data from parent to child with input binding
- Parent listens for child event
- Parent and children communicate via a service
Moreover, it's worth noting that ConfigFormComponent
, TypeFormComponet
and TreatmentFormComponet
are brothers and I link them by two services: FormDataService
and FormStateService
.
Modern browsers support two HTTP-based APIs: XMLHttpRequest (XHR) and JSONP. A few browsers also support Fetch.
The Angular HTTP library simplifies application programming with the XHR and JSONP APIs.
This experiment covers angular http in details of the following topics:
- A HTTP client demo.
- Fetch data with http.get.
- RxJS library.
- Enable RxJS operators.
- Process the response object.
- Handle errors.
- Send data to the server.
- Fall back to promises.
- Cross-Origin Requests: Wikipedia example.
- Search parameters.
- Observables.
- in-memory web api.