title: Type 'Subscription' is missing the following properties from type 'Observable<StringMap<any>>'
body: <blockquote>
    <p>ERROR : Type 'Subscription' is missing the following properties from
    type 'Observable>': _isScalar, source, operator, lift,
    and 6 more.ts(2740)</p>
  </blockquote>
  
  <p>Here I have attached my code. </p>
  
  <p>Here, in my case, I have two methods which return an observable, but getByTypeData and getByType. But, on returning this.getByType(type).. from getByTypeData() I am getting above error. </p>
  
  <p>P.S.: I want to subscribe getByTypeData in my component which should return me an observable. AND I AM NEW TO RXJS...</p>
  
  <pre><code>
    /*
     interface IStringMap&lt;T&gt; {
          [index: string]: T;
      }
      */
  
      getByTypeData(type: string, ignoreApi = false): Observable&lt;stringMap&lt;any&gt;&gt; {
          if (ignoreApi) {
              this.handleConfig(type);
          }
          return this.getByType(type)
              .subscribe(response =&gt; {
                  const config = response.result ? response.data : {};
                  return this.handleConfig(type, config);
              });
      }
  
    // This method in another file (Just for reference)
  
      getByType(type: string): Observable&lt;stringMap&lt;any&gt;&gt; {
          return this.httpClient.get(`get url`);
      }
  
        handleConfig(type: string, config: stringMap&lt;string | number&gt; = {}): Observable&lt;stringMap&lt;any&gt;&gt; {
          if (type === this.types) {
              config.token = this.anotherservice.GetKey('mykey');
              if (config.token) {
                  // logic
              }
          }
  
          if (type === this.types) {
              // logic
          }
          return of(config);
      }
  
  </code></pre>