import { Injectable } from '@angular/core';
import { Headers, Http, Response } from '@angular/http';
import { Observable } from '@rxjs/Observable';
import 'rxjs/Rx';
import 'rxjs/add/observable/throw';
@Component({});
export shellModule{}
I found this code snippet in my Angular application that I borrowed from another source. The exported module definitions have been removed for simplicity. I am utilizing it to create a service for API calls.
One thing that puzzles me is why the Observable object is imported separately even though the entire rxjs library has already been imported. If an entire module is being imported, why import specific objects individually? I posed this question on the original forum where I came across this code, but unfortunately, there was no response. I am curious to know if there are any benefits or optimizations related to importing individual objects over entire modules.