Same -Origin error angular2

I get this

SecurityError: Failed to execute ‘open’ on ‘Document’: Can only call open() on same-origin documents.

Applied the header(‘Access-Control-Allow-Origin: *’) . but still getting the above error !