|
Answer» Advantages of Angular 2 over Angular are given below- - Simpler to Learn
- Simpler Dependency Injection
- It’s is a platform not only a language:
- IMPROVED Speed and Performance: No $Scope in Angular 2, AOT
- Modular, cross-platform
- Flexible Routing with Lazy Loading Features
- Benefits of ES6 and Typescript.
14. How do observables differ from promises? | | Observable | Promise |
|---|
| 1. | USED from the library RxJS. import { Observable } from 'rxjs'; | Built-in API. | | 2. | Can show multiple values using setInterval() method | Can resolve only ONE async task and cannot be used again | | 3. | Can unsubscribe from the observables no LONGER needed. | A promise cannot be canceled. | | 4. | Lazy. Observable is called only when we subscribe. | Not lazy. | | 5. | Rich set of operators in the library like map, filter, pipe, RETRY, etc. | No such additional features available |
|