# Ionic Framework Trouble

**URL:** <https://community.dreamfactory.com/t/ionic-framework-trouble/2412>\
**Category:** REST API\
**Created:** [March 24, 2016, 5:17pm UTC](https://community.dreamfactory.com/t/ionic-framework-trouble/2412 "2016-03-24T17:17:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Declan\_Murphy](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@Declan\_Murphy](https://community.dreamfactory.com/u/Declan_Murphy)\
**Post date:** [March 24, 2016, 5:17pm UTC](https://community.dreamfactory.com/t/ionic-framework-trouble/2412/1 "2016-03-24T17:17:38Z")

</div>

So far this is the only (DF related) code I have entered:

var todoApp = angular.module(‘starter’, [‘ionic’, ‘ngDreamFactory’], function ($compileProvider) {  
.constant(‘DSP\_URL’, ‘https://**/api/v2’)  
.constant(‘DSP\_API\_KEY’,'gd1**gdfa1’);

I am getting the following error on Ionic Serve:

XMLHttpRequest cannot load http://\*\*\*\*\*\*\*\*\*\*/api/v2/rest/api\_docs. Response to preflight request doesn’t pass access control check: Credentials flag is ‘true’, but the ‘Access-Control-Allow-Credentials’ header is ‘’. It must be ‘true’ to allow credentials. Origin ‘[http://localhost:8100](http://localhost:8100)’ is therefore not allowed access.  
ionic.bundle.js:21162 TypeError: Cannot read property ‘status’ of null  
at Object.obj.on.error (angular-dreamfactory.js:158)  
at angular-dreamfactory.js:1571  
at ionic.bundle.js:18913  
at processQueue (ionic.bundle.js:23399)  
at ionic.bundle.js:23415  
at Scope.$eval (ionic.bundle.js:24678)  
at Scope.$digest (ionic.bundle.js:24489)  
at Scope.$apply (ionic.bundle.js:24783)  
at done (ionic.bundle.js:19196)  
at completeRequest (ionic.bundle.js:19368)

When I run it on my phone through Chrome Inspect:

undefined : undefined http://\*\*\*\*\*\*\*\*\*\*/api/v2/rest/api\_docs

---

<div class="post-metadata">

**Author:** ![formerstaff](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.dreamfactory.com/formerstaff/32/1133_2.png) [@formerstaff](https://community.dreamfactory.com/u/formerstaff)\
**Post date:** [March 25, 2016, 2:52pm UTC](https://community.dreamfactory.com/t/ionic-framework-trouble/2412/2 "2016-03-25T14:52:25Z")

</div>

This is a CORS error.

Have you configured CORS for your DreamFactory?  
[https://wiki.dreamfactory.com/DreamFactory/Tutorials/Enabling\_CORS\_access](https://wiki.dreamfactory.com/DreamFactory/Tutorials/Enabling_CORS_access)
