Access to XMLHttpRequest at 'https://authapistaging2.mymonow.com/api/auth/token/create' from origin 'http://localhost:8101' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

Don’t:

  • needlessly construct Promises
  • do anything with custom HttpHeaders here
  • abuse any out of laziness
  • manually unmarshal and marshal JSON when dealing with HttpClient
  • use providedIn: 'root'

Do:

  • deal with CORS issues on the server side
  • use codefences when posting
  • give methods descriptive names (as opposed to con)
  • give proper types to all function parameters and return values
  • follow coding conventions when it comes to capitalization: DialingCode is a class, not an object member name