I am trying to understand how to use Observables in Angular 2. I have this service:
import {Injectable, EventEmitter, ViewChild} from \'@angular/core\'; i
Here's an example
// in the service getVehicles(){ return Observable.interval(2200).map(i=> [{name: 'car 1'},{name: 'car 2'}]) } // in the controller vehicles: Observable> ngOnInit() { this.vehicles = this._vehicleService.getVehicles(); } // in template {{vehicle.name}}