title: angular 4 component call multiple time same service
body: <p>I have an application in angular 4 and i had builded almost all the components in this way:</p>
  
  <pre><code> export class AreaProdottiComponent implements OnInit,OnDestroy {
  
      subscription: ISubscription;
  
  
      constructor(private someservice:Service){
          this.subscription = someserviceObservable.subscribe(
                  res=&gt;{
                      console.log('everything ok')
                  }
          )
      }
  
      ngOnInit(){
          this.someservice.fn()
      }
  
      ngOnDestroy(){
          this.subscription.unsubscribe()
      }
  }
  </code></pre>
  
  <p>these components interact with services built almost in this way:</p>
  
  <pre><code>export class Service(){        
      someservicesubj=Subject&lt;any&gt;();
      someserviceObservable=someservicesubj.asObservable();
  
      fn(){
          doCall.subscribe(
                  res=&gt;{
                      this.someservicesubj.next();
                  }
          )
      }
  
      doCall()Observable&lt;any&gt;{
          //some http call is here
      }
  }
  </code></pre>
  
  <p>So when components like this are created they call for an automatic HTTP method from the services, and everything seems to work, but if I navigate the application and I return to the same component for the second time the number of calls that make as soon as the component is created are doubled, the fn method is called 2 times. This behavior increases every time I destroy and recreate the component.</p>
  
  <p>Example:</p>
  
  <p>Opening the component in the console i'll read 'everything ok', go out and return i'll read 'everything ok' 3 times, the old one plus 2 other.</p>
  
  <p>I think i miss something in the navigation strategy or in the building of the service, but i really don't ifnd the solution.</p>
  
  <h1>Update</h1>
  
  <p>I had tried as @trichetriche  has suggested but it still donesn't work. i had used ISubscription instead is that the possible problem? </p>
  
  <h1>Update</h1>
  
  <p>@trichetriche Was right but i had a service called inside another subscriber and so i missed the fact that was the first service that was unsubscribed</p>