title: Why Subscribe is working without Observable in Angular
body: <p>I wanted to understand some basics of Angular and <code>HttpClient</code>. My code is working but I don't understand how. I checked these two links:</p>
  <ol>
  <li><a href="https://stackoverflow.com/questions/61353881/how-to-correctly-subscribe-angular-httpclient-observable">How to correctly subscribe Angular HttpClient Observable?</a></li>
  <li><a href="https://stackoverflow.com/questions/12736269/how-to-declare-return-types-for-functions-in-typescript">How to declare Return Types for Functions in TypeScript</a></li>
  </ol>
  <p>I've watched this video on YouTube:</p>
  <ol>
  <li><a href="https://www.youtube.com/watch?v=iZY4roDiqXY&amp;ab_channel=SahosoftSolutions" rel="nofollow noreferrer">observable and subscribe in Angular 8 | Angular 8 Tutorial in Hindi</a></li>
  </ol>
  <p>I learnt that the syntax of <code>HttpClient</code>'s GET method is:
  <code>get(url: string, options: {...}): Observable&lt;any&gt;</code></p>
  <p>So I did as I was told to do in the video. Here is my case 1:</p>
  <p><strong>UserService</strong></p>
  <pre><code>...
  export class UserService {
    constructor(private _http: HttpClient) { }
    getAllUsers() {
      return this._http.get(&quot;https://jsonplaceholder.typicode.com/users&quot;):Observable&lt;any&gt;;
    }
  }
  </code></pre>
  <p>Why VSCode is complaining:</p>
  <blockquote>
  <p>Value of type 'typeof Observable' is not callable. Did you mean to include 'new'?</p>
  </blockquote>
  <p>In fact my code works perfectly If I don't even specify <code>Observable</code> at all. Here is case 2:</p>
  <pre><code>...
  export class UserService {
    constructor(private _http: HttpClient) { }
    getAllUsers() {
      return this._http.get(&quot;https://jsonplaceholder.typicode.com/users&quot;);
    }
  }
  </code></pre>
  <p>And here's my component(for both the cases):</p>
  <p><strong>UserList</strong></p>
  <pre><code>  users=[];
  
    constructor(private userService: UserService) { }
  
    ngOnInit() {  
      this.fetchAllUsers();  
    }
  
    fetchAllUsers() {
      this.userService.getAllEUsers().subscribe(
        res =&gt; {
          this.users.push(res)
        }
      );    
    }
  </code></pre>
  <p>Please point out my mistakes in both cases. I think I'm violating Angular rules somewhere.</p>
  <p>PS: Screenshot of the youtube tutorial:</p>
  <p><a href="https://i.stack.imgur.com/EBSHK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EBSHK.png" alt="enter image description here" /></a></p>