title: How to use combineLatest and takeUntil rxjs operators in Angular 5
body: <p>I see that in Angular 5 one should be using rxjs operators differently and importing from <code>'rxjs/operators'</code> but I'm a little unclear on how it is supposed to work. I have something like: </p>
  
  <pre><code>import { Observable } from 'rxjs/Observable';
  
  import { combineLatest, takeUntil } from 'rxjs/operators';
  
  @Component({ ... })
  export class FooComponent implements OnInit, OnDestroy {
  
  
    constructor(private route: ActivatedRoute) {}
  
  
    ngOnInit() {
  
      this.route_data = Observable.combineLatest(this.route.params, this.route.data,
                               (params, data) =&gt; ({params,data}));
  
      this.route_data_sub = this.route_data.takeUntil(this.destroyed$).subscribe(
        (params_and_data) =&gt; {
                              ...
                             }
     }
   ...
  }
  </code></pre>
  
  <p>but I'm getting <code>Observable.combineLatest is not a function</code> errors. If I add the combineLatest operator the old way it works for combineLatest, but then <code>takeUntil</code> is now not found. How is this supposed to be done with Angular 5?</p>
  
  <p>I have quite a bit of rxjs code all over the app and don't know how it is supposed to be rewritten or how to change the imports. Does everything have to be rewritten with .pipe() now?</p>