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

zone.js promise overwritten when deploy angular 2 (4) application on apache tomcat
Deploying Angular on Linode
Angular-cli with Stylus doesn't work
Use angular-cli proxy for multiple backends
chunk files size are multiplied by 5 on build size ng build --prod
AngularCli: disable minification
Angular Cli e2e element explorer not responding
Angular cli generate a service and include the provider in one step
Angular-cli not generating dist directory with ng build
How to update service json or array value on click in angular2?
How to revert from Angular-cli to Angular without cli for server-side rendering with Angular Universal
How to change file index outside the root
angularCLI Access-Control-Allow-Origin Multiple Origin Domains
Angular CLI how to merge json files
Angular CLI (ng) use single instead of double quotes
can't install angular cli on ubuntu 16.04

Categories

HOME
sql-server
rotation
ipython
jbehave
formal-verification
google-sheets-api
deep-linking
visualization
amazon-product-api
couchdb-2.0
jscript
safari
phaser-framework
data-science-experience
flexbox
mongodb-query
google-openid
prestodb
plsqldeveloper
apple-tv
multiplayer
jquery-waypoints
non-deterministic
python-textprocessing
katharsis
net-snmp
maximo
dss
pentaho-report-designer
dd-wrt
devforce
rowcount
helix-3d-toolkit
freebase
polymorphism
receipt
color-scheme
nlb
liquid-xml
mongoexport
jquery-multidatespicker
parent
dojox.mobile
homekit
stress-testing
double-buffering
sgmlreader
pinvoke
greenhills
adler32
cjson
gherkin
inotifypropertychanged
gemini
logcat
twgl.js
acm
geodjango
kendo-menu
isml
apache-mina
jazz
sqoop2
jai
c++-actor-framework
symfony-2.6
collabnet
log4cplus
sthttprequest
ember-addon
aquafold
colt
dbsetup
map-force
resource-files
visual-studio-addins
wic
trimming
threadx
windows-update
ng-pattern
google-closure-library
dwolla
shiva3d
fraud-prevention
web-safe-fonts
point-sprites
hobo
mysql-error-1045
webkit-transform
datamember
ihttphandler
squeel
post-redirect-get
swfloader
economics
data-execution-prevention
self-reference

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