title: In Angular Service is not returning any value
body: <p>My API is fine, when browsed through Browser returning the Desired values.</p>
  <p>But when I call the API in Service of angular it is not returning any value.</p>
  <p>Any help or suggestion is highly appreciated, as I am stuck for two days now.</p>
  <p>Below is my Service and Component Code.</p>
  <p>Service.ts File</p>
  <pre><code>getStudentList(): Observable&lt;IStudent[]&gt;{
  return this._http.get&lt;IStudent[]&gt;(this.ApiUrl);
  }
  </code></pre>
  <p>Component.ts File</p>
  <pre><code>StudentList:IStudent[] ;
  
  
  constructor(private _StudentService:SharedService) {
  this.StudentList=[
    //  {Id:1,Name:'Pradeep',Age:29},
    //  {Id:2,Name:'Rakesh',Age:35}
  ]
  </code></pre>
  <p>}</p>
  <pre><code>ngOnInit(): void {
   //service call should always be done in ngOnInit
  this._StudentService.getStudentList().subscribe(data =&gt; this.StudentList = data);
  </code></pre>
  <p>}</p>