title: Angular 5 Cannot read property 'subscribe' of undefined when am trying to subscribe which is not a type of Service Method
body: <p>I have a method like,</p>
  
  <pre><code>validatingUpdateBtn: boolean;
  
  Validating(): Observable&lt;boolean&gt; {
  
      //Do some function
  
      if (this.validatingUpdateBtn) {
           return Observable.of(true).map(res =&gt; res);
      }
      else {
           return Observable.of(false).map(res =&gt; res);
      }
  }
  </code></pre>
  
  <p>Now as show in the below method, am subscribing to above method.</p>
  
  <pre><code>handleSelection(){
      this.Validating().subscribe(
            (res) =&gt; {
              if (res) {
                //Do some work
              }else{
                //Do some work
              }
            }
          )
  }
  </code></pre>
  
  <p>but am getting <strong>Cannot read property 'subscribe' of undefined</strong> when am trying to subscribe <strong>Validating()</strong> method.</p>
  
  <p>Am not getting whats going wrong?</p>