angular-cli


angularCLI Access-Control-Allow-Origin Multiple Origin Domains


Error>>>> XMLHttpRequest cannot load http://localhost:60712/api/Default. Request header field Access-Control-Allow-Origin is not allowed by Access-Control-Allow-Headers in preflight response.
running ng serve   http://localhost:4200/
Not sure what to do.  I just want to test for local development.
I did the npm install ember-cli-cors
I added Cors to mvc project.
my headers in my angularCli project looks like
let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8', 'Access-Control-Allow-Origin': '*',
'Access-Control-Allow-Credentials': 'false','Access-Control-Allow-Methods': 'GET,HEAD,OPTIONS,POST,PUT',
'Access-Control-Allow-Headers': 'Access-Control-Allow-Headers, Origin,Accept, X-Requested-With, Content-Type, Access-Control-Request-Method, Content-Type' });
let options = new RequestOptions({ headers: headers });
return this._http.get(this._data, options)
.map((response: Response) => <any[]>response.json())
.catch((error: any) => Observable.throw(error.json().error ))//|| this.showError()
.do(data => console.log('List: ' + JSON.stringify(data)));
In AngularCli my Service I had to remove the headers I included and it worked.
this._http.get("http://localhost:60712/api/Default")
.map(result => (result.json()))
.do(result => console.log("RESULT: ", JSON.stringify(result)))
.subscribe(result => {
// JSON.stringify(result);
}, error => {
console.log("ERROR: ", error);
});

Related Links

angular cli update issue on local folder
Access to -aot parameter in code
Missing peer dependencies after installing latest angular-cli: What to do?
angular-cli ng serve : Error: No errors
Getting error after Angular cli update
Does angular-cli uses rollup to do ahead-of-time compilation and adding all into one file?
Angular CLI install error
Using glob for assets in angular-cli throws error
Importing Global SCSS into Component SCSS with Angular-CLI
Error during AOT build with angular-cli 24 and Angular 2.4.1
Add importer to node-sass in angular-cli project
angular-cli#1.0.0-beta.23 (2016-12-15) NOT on npm
Angular cli for existing github project
How to pass config data to NgModule so NgModule will be compiled with AOT
Cloning a repo based on Angular CLI
How can I speed up Angular CLI Live Reload - 1-2 minutes per change

Categories

HOME
vue.js
symfony
npm
scipy
textwatcher
cpu-architecture
phpstorm
gspread
ext.net
devstack
ng-admin
onenote-api
outlook-web-addins
wysiwyg
uiscrollview
game-physics
automata
maxima
rapidjson
opera-mini
arm-template
off-canvas-menu
flexlm
eclipselink
boolean-expression
kadanes-algorithm
android-fragmentactivity
backpropagation
sensu
cruisecontrol.net
facebook4j
servicemix
jquery-waypoints
reactiveui
bxslider
ivy
getjson
twitter-bootstrap-2
spreedly
xamarin.uitest
codesys
s3cmd
ddms
bayesian-networks
react-native-router-flux
bing-translator-api
openweathermap
estimation
jtds
w3-total-cache
ideone
tuleap
seamless-immutable
mouseclick-event
ogre3d
crash-reports
forerunnerdb
sqlexception
rxvt
libreadline
c64
zurb-foundation-apps
pax-web
linkageerror
amf
codesign
twgl.js
mfc-feature-pack
axes
magento-1.4
approval-tests
license-key
persistence.xml
windows-vista
ninject.web.mvc
apigee-baas
programming-paradigms
ipojo
virus
custom-url
word-2013
alphablending
node-imagemagick
alertifyjs
late-static-binding
initialization-vector
crystal-reports-10
fogbugz-api
.net-cf-3.5
nimrod
installshield-2009
leptonica
dig
backbone-relational
multiple-conditions
appfog
sametime
trailing-slash
attachevent
blockingqueue
couchdb-lucene
mpmovieplayer
file-exists
emacs23
querystringparameter
selectmanycheckbox
text-size
datamember
qtembedded
goliath
dcpu-16
junit3
audiostreamer
j-interop
sitemappath
graniteds
castle-validators
weborb
usergroups

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App