I have Angular 4 application. 
I invoke getCity() method in my service's constructor to initialize cityId property. I use cityId in another method? for example, getData(). When I'm trying to invoke getData() in component I receive error that cityId is undefined. As I think it happens because getCity() doesn't finish it's execution when getData() started to execute.
The both of the methods are use Observables, and return Observable. 
I solved it with getCity().concatMap((id) => getData(...)).

Could You tell me please is it right approach? Maybe there are more correct ways?

```
@Injectable()
export class CustomService {

  cityId: number;

  constructor(private http: HttpClient,
              private citiesService: CitiesService) {
    this.getCityId()
  }

  getCityId() {
    return this.citiesService.getCity().subscribe(
      (city) => {
        this.cityId = city['id']
      });
  }

  getData() {
    /* use this.cityId here */
  }

```