Angular2 dependency explanation

I am wondering if any of you can explain the dependencies that Angular2 uses. So far, I have learned that Angular2 always uses the following:

RxJs
Angular2 Polyfills
ZoneJS

Could you explain to me in simple words what each of them is responsible for and why they are needed?

thank

+4
source share
4 answers
  • Rxjs provides the implementation of reactive programming concepts. Angular2 based on it for the custom event in the components ( EventEmittera class that extends Subjectone) and in its support for HTTP (methods, such as get, post...).

  • angular2-polyfills.js Angular2 ZoneJS Reflect. ZoneJS - Angular2 (. : Angular2, AngularJS $?). Reflect-metadata - . Angular2 . , (, ,...).

  • polyfills API (, ES6).

  • SystemJS, , . , TypeScript, .

:

+5
+1

Rxjs

RxJS (Reactive Extensions JavaScript) - Observable. - , Promises, Angular 1, , .

RxJs - , angular2 / i.e HTTP-, RxJs, .map() and .subscribe() HTTP-.

JS

- , , Angular 2 , , . . angular2 ZoneJs, , Etc.

Angular2

, , , .. .

. angular2

https://daveceddia.com/angular-2-dependencies-overview/

+1

Rxjs

. . , :

  {{  data  | async }}

:

 data  = Rx.Observable.create(...);

http , - :

 data = http.get(...);

, - -, . , " ?" , : " ? , , ? (, ) (, )?

( ) , , .

, ():

var stream = new ObservableEventStream('left mouse click')
     .skipFirst(3) // skip the first 3 clicks
     .keepLatest() // only output the latest event
     .combineWith(new ObservableEventStream('right mouse click')) // combine with right clicks
     .throttle(300); // throttle the events so that the speed is 1 event per 300 ms

// now that you have the stream, setup subscribers to handle the event
stream.subscribe(event=> { DoSomethingWithClick(event);  });

, , , . .

, . .

ZoneJS

Angular2 API- API- , Angular2 , . , Angular2, .

, , alert(timeout), , .

angular 1 $scope.$apply, , - angular. angular 2 - .

ES6 JavaScript- JavaScript. ES6, , - , . Chrome , IE . . , es6-shim angular ES6 , .

A polyfill is almost the same as a gasket, except that it provides support for future standards (not yet standard or at the application stage)

+1
source

All Articles