title: How to call function in Angular every 10 seconds
body: <p>How can you call Observable function to download data from server every 10 seconds?</p>
  
  <p>My App service</p>
  
  <pre><code>    getDevices (): Observable&lt;Device[]&gt; {
      return this.http.get(this.deviceUrl)
        .map(this.extractData)
        .catch(this.handleError);
  }
  </code></pre>
  
  <p>My AppComponent</p>
  
  <pre><code>ngOnInit():void {
      this.getData();
      this.getLastDeviceInterior();
      this.getOutDevice();
      this.getSetings();
    }
  
    getData()
    {
      this.dataService.getDevices().subscribe( devices =&gt; this.devices = devices,
        error =&gt;  this.errorMessage = &lt;any&gt;error);
    }
  </code></pre>