title: How to call web API return Boolean from angular 7?
body: <p>I work on angular 7 I face issue I can't call web API return Boolean from angular 7</p>
  <p>so how call web API on angular 7 return true or false</p>
  <pre><code>   [HttpGet]
      [Route(&quot;CompareExcel/SelectedOptions&quot;)]
      public IActionResult CompareExcel( int SelectedOptions)
      {
          var DisplayFileName = Request.Form.Files[0];
          string fileName = DisplayFileName.FileName.Replace(&quot;.xlsx&quot;, &quot;-&quot;) + Guid.NewGuid().ToString() + &quot;.xlsx&quot;;
          string Month = DateTime.Now.Month.ToString();
          string DirectoryCreate = Path.Combine(myValue1, Month);// myValue1 + &quot;\\&quot; + Month + &quot;\\&quot; + fileName;
          CExcel ex = new CExcel();
      
          string error = &quot;&quot;;
          int rowCount = 0;
          var selectedFile = &quot;&quot;;
          var filedata = ContentDispositionHeaderValue.Parse(Request.Form.Files[0].ContentDisposition).FileName.Trim('&quot;');
          var dbPath = Path.Combine(DirectoryCreate, fileName);
          if (SelectedOptions == 1)
          {
              selectedFile = &quot;Gen.xlsx&quot;;
          }
          else if(SelectedOptions == 2)
          {
              selectedFile = &quot;DeliveryGeneration_Input.xlsx&quot;;
          }
          var InputfilePath = System.IO.Path.Combine(GetFilesDownload, selectedFile);
          using (var stream = new FileStream(dbPath, FileMode.Create))
          {
              Request.Form.Files[0].CopyTo(stream);
              stream.Flush();
              stream.Close();
          }
          GC.Collect();
          bool areIdentical = ex.CompareExcel(dbPath, InputfilePath, out rowCount, out error);
          if(areIdentical==true)
          {
              return Ok(true);
          
          }
          else
          {
              return Ok(false);
              
          }
      
      }
  </code></pre>
  <p>link used to call web API from angular</p>
  <pre><code>http://localhost:61265/api/DeliverySys/CompareExcel/SelectedOptions?=1
  </code></pre>
  <p>when call function above it return only Boolean true or false</p>
  <p>if compare excel identical then return true</p>
  <p>if compare excel Not identical then return false</p>
  <pre><code>so on angular service.ts
  //what I write 
  component Type script ts
  what I write
  html component
  what I write 
  </code></pre>
  <p><strong>updated post</strong></p>
  <pre><code>on service ts i do as below :
  CompareExcel(SelectedOptions)
  {
    this.http.get('http://localhost:61265/api/DeliverySys/CompareExcel/SelectedOptions?=' + SelectedOptions).subscribe(result =&gt; {
      console.log(result);
  });
  }
  on component ts
  i call it as 
  
    this._dataService.CompareExcel(this.selectedoptions.toString())
  so are this correct 
  
  on component html 
  what i write 
  </code></pre>