title: incorrect imports in angular 6/rxjs of/map etc
body: <p>I am getting the following errors, trying to update a solution to angular 6.</p>
  
  <pre><code>ERROR in ../app/AuthService.ts
        TS2339: Property 'of' does not exist on type 'typeof Observable'.
  ERROR in ../app/AuthService.ts
        TS2339: Property 'map' does not exist on type 'Observable&lt;any&gt;'.
  ERROR in ../app/AuthService.ts
        TS2339: Property 'map' does not exist on type 'Observable&lt;boolean&gt;'.
  ERROR in       TS2339: Property 'map' does not exist on type 'Observable&lt;any&gt;'.
  </code></pre>
  
  <p>I am using the latest version of rxjs, and the imports (at least on paper) seem correct?</p>
  
  <pre><code>"rxjs": "^6.2.0",
  </code></pre>
  
  <p>My file is as follows:</p>
  
  <pre><code>import { Injectable } from "@angular/core";
  import { NGXLogger } from "ngx-logger";
  import { CanActivate, Router } from "@angular/router";
  import { HttpClient, HttpHeaders } from "@angular/common/http";
  import { Observable } from "rxjs";
  import { StorageService } from "./lib/storage/StorageService";
  import { map, catchError } from "rxjs/operators";
  import { of } from "rxjs";
  import * as _ from "lodash";
  
  /**
   * class that represents the access token
   * returned from /connect/token (IdentityServer 4)
   */
  export class Token {
      // ReSharper disable once InconsistentNaming
      access_token: string;
  
      // the user email.
      email: string;
  }
  
  @Injectable()
  export class AuthService {
      /**
       * the access token.
       */
      token: Token;
  
      constructor(
          private readonly http: HttpClient,
          private readonly logger: NGXLogger,
          private readonly storage: StorageService
      ) {
      }
  
      /**
       * return true if the user has a valid token.
       */
      isLoggedIn(): Observable&lt;boolean&gt; {
          return this
              .loadToken()
              .map(_ =&gt; this.token &amp;&amp; this.token.access_token.length &gt; 0)
              .catch(e =&gt; {
                  this.logger.debug(e);
                  this.token = null;
                  return Observable.of(false);
              });
      }
  
      logout() {
          this.logger.info("logging out");
          this.storage.clear("token");
      }
  
      /**
       * login, using the supplied email and password.
       * @param email the email address.
       * @param password the password.
       */
      login(email: string, password: string): Promise&lt;Token&gt; {
          this.logger.info(`user ${email} attempting login`);
          const login = {
              username: email,
              password: password,
              grant_type: "password",
              scope: "api",
              client_id: "api",
              client_secret: "secret"
          };
          const headers: HttpHeaders = new HttpHeaders().set("Content-Type", "application/x-www-form-urlencoded");
          const post = this.http.post&lt;Token&gt;(
              "connect/token",
              this.encodeObjectToParams(login),
              { headers: headers });
          return post
              .toPromise()
              .then((_: Token) =&gt; this.token = this.saveToken(_));
      }
  
      register(email: string, password: string, confirmPassword: string): Observable&lt;any&gt; {
          this.logger.info(`user ${email || "&lt;null&gt;"} registration request`);
          const uri = "api/register";
          const registration = {
              email,
              password,
              confirmPassword
          };
          return this.http
              .post&lt;any&gt;(
                  uri,
                  registration)
              .map(_ =&gt; _)
              .catch(e =&gt; {
                  this.logger.debug(`exception :: ${uri} :: `, e);
                  return Observable.throw(e.error);
              });
      }
  
      /**
       * encode the supplied object to a set of form variables.
       * @param instance the object to encode.
       */
      private encodeObjectToParams(instance: any): string {
          return Object.keys(instance)
              .map(key =&gt; encodeURIComponent(key) + "=" + encodeURIComponent(instance[key]))
              .join("&amp;");
      }
  
      /**
       * save the supplied token
       */
      private saveToken = (token: Token): Token =&gt; this.storage.save("token", token);
  
      /**
       * attempt to load the token from local storage,
       * and test that it is valid.
       */
      private loadToken() {
          this.logger.debug("loading 'token'");
          const token = this.storage.load&lt;Token&gt;("token");
          return this.testToken(token)
              .map(_ =&gt; this.token = token);
      }
  
      /**
       * test that the supplied login token works.
       * @param token the token to test.
       */
      isTokenEmailValid = token =&gt; this.http
              .get&lt;any&gt;("api/user")
              .map((response: any) =&gt; response !== null &amp;&amp; response.isAuthenticated);
      testTokenThrottle = _.throttle(token =&gt; {
          this.logger.info(`testing token :: ${JSON.stringify(token)}`);
          return this.isTokenEmailValid(token);
      }, 300000);
      private testToken(token: Token): Observable&lt;boolean&gt; {
          const valid = this.testTokenThrottle(token) || this.isTokenEmailValid(token);
          return valid;
      }
  }
  
  /**
   * Authorisation guard, to ensure that a user
   * not logged in is redirected to the login page.
   */
  @Injectable()
  export class AuthGuard implements CanActivate {
  
      constructor(
          private readonly authService: AuthService,
          private readonly logger: NGXLogger,
          private readonly router: Router) { }
  
      canActivate(): Observable&lt;boolean&gt; {
          this.logger.debug("authorisation guard testing login status");
          return this.authService.isLoggedIn().map(_ =&gt; {
              this.logger.info(`authorisation guard :: login status ${_}`);
              if (_)
                  return true;
              this.router.navigate(["login"]);
              return false;
          }).catch(_ =&gt; {
              this.logger.info(`authorisation guard :: login error ${_}`);
              this.router.navigate(["login"]);
              return Observable.of(false);
          });
      }
  }
  </code></pre>