How to unblock the CORS policy


i tried apiurl in post method for signup page…

import { Injectable } from '@angular/core';
import { Http, Headers, HttpModule } from '@angular/http';
import 'rxjs/add/operator/map';

let apiUrl = '';

export class AuthServiceProvider {

  constructor(public http: Http) {
    console.log('Hello AuthServiceProvider Provider');
  public register(data){
    return new Promise((resolve, reject) => {
      let headers = new Headers();
        headers.append('Content-Type', 'application/json');
        headers.append('Access-Control-Allow-Origin', '*');
         headers.append( 'Access-Control-Allow-Headers', 'Authorization, Content-Type' );

        //headers.append('Access-Control-Allow-Origin', 'http://localhost:8100');
//headers.append('Access-Control-Allow-Credentials', 'true');

        alert(apiUrl);'account', JSON.stringify(data), {headers: headers})
          .subscribe(res => {
          }, (err) => {


it shows the error like this…“Access to XMLHttpRequest at ‘’ from origin ‘http://localhost:8100’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: It does not have HTTP ok status.”