title: How to enable CORS in AngularJs?
body: <p>I am trying to consume a ZOOM API POST method using angularJS:</p>
  <p><a href="https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarpanelistcreate" rel="nofollow noreferrer">/webinars/{webinarId}/panelists</a></p>
  <p>When I run the solution locally, my angular controller, returns an error:</p>
  <p><a href="https://i.stack.imgur.com/TBPOn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TBPOn.png" alt="screen shot of error" /></a></p>
  <p>Zoom provides the code to be implemented to be able to, through the end point, add panelists to a webinar. Doing this using Zoom API will save us a lot of time since sometimes we have 30+ panelists per webinar.</p>
  <p>This is something new for me, and so far I was doing ok working on the angular application, but this error has brought a new level of complexity. I found this question/answer in SO:</p>
  <p><a href="https://stackoverflow.com/questions/43871637/no-access-control-allow-origin-header-is-present-on-the-requested-resource-whe/43881141#43881141">How to use a CORS proxy to get around “No Access-Control-Allow-Origin header” problems</a></p>
  <p>But I’m really out of my depth on all of this stuff and I would like to ask for some help and guidance on how I can correct this, perhaps using the example provided in the link above this paragraph.</p>
  <p>Here is the code I have so far and it's failing:</p>
  <pre><code>// call zoom api to add panelists
  var xhr = new XMLHttpRequest();
  xhr.withCredentials = true;
  
  xhr.addEventListener(&quot;readystatechange&quot;, function () {
      if (this.readyState === this.DONE) {
          console.log(this.responseText);
      }
  });
  xhr.open(&quot;POST&quot;, &quot;https://api.zoom.us/v2/webinars/&quot;  + scope.webinarId + &quot;/panelists&quot;);
  xhr.setRequestHeader(&quot;content-type&quot;, &quot;application/json&quot;);
  xhr.setRequestHeader(&quot;authorization&quot;, &quot;Bearer &quot; + $scope.accessToken + &quot;);
  xhr.send($scope.panelists)
  </code></pre>
  <p>Thank you for your help,
  Erasmo</p>