Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ionic framework Ionic 2应用程序-不通过IOS模拟器进行任何Ajax调用_Ionic Framework_Ionic2 - Fatal编程技术网

Ionic framework Ionic 2应用程序-不通过IOS模拟器进行任何Ajax调用

Ionic framework Ionic 2应用程序-不通过IOS模拟器进行任何Ajax调用,ionic-framework,ionic2,Ionic Framework,Ionic2,我一直在尝试通过模拟器运行这个应用程序 当我运行ionic emulate ios时,此应用程序不会进行任何Ajax调用 当我运行ionic Simulate ios-c-l时,这个应用程序运行得非常好 这是我的provider类,我几乎完全是从Ionic Conference应用程序复制的 import {Injectable} from 'angular2/core'; import {Http, Headers} from 'angular2/http'; import 'rxjs/add

我一直在尝试通过模拟器运行这个应用程序

当我运行ionic emulate ios时,此应用程序不会进行任何Ajax调用

当我运行ionic Simulate ios-c-l时,这个应用程序运行得非常好

这是我的provider类,我几乎完全是从Ionic Conference应用程序复制的

import {Injectable} from 'angular2/core';
import {Http, Headers} from 'angular2/http';
import 'rxjs/add/operator/map';
import {Storage,SqlStorage} from 'ionic-framework/ionic';

/*
  Generated class for the RafitoData provider.

  See https://angular.io/docs/ts/latest/guide/dependency-injection.html
  for more info on providers and Angular 2 DI.
*/
@Injectable()
export class RafitoData {
  static get parameters() {
    return [[Http]];
  } 
  constructor(http) {
    this.http = http;
    this.districts = null;
    this.storage = new Storage(SqlStorage);
  }


addCustomer(customer) {
    // don't have the data yet
    return new Promise(resolve => {

      var headers = new Headers();
      headers.append('Content-Type','application/json');

      var partialURL = '/rafitows/userInfo/create';
      var body = JSON.stringify(customer);
      // We're using Angular Http provider to request the data,
      // then on the response it'll map the JSON data to a parsed JS object.
      // Next we process the data and resolve the promise with the new data.
      this.http.post(partialURL,body,{headers:headers})
        .map(res => res.json())
        .subscribe(data => {
          resolve(data.status);
        }, err=> {console.log(err)});
    });
  }
}
我不确定我做错了什么。我有科尔多瓦白名单插件

这是我的信息:

Cordova CLI: 5.4.0
Ionic Version: 2.0.0-beta.1
Ionic CLI Version: 2.0.0-beta.17
Ionic App Lib Version: 2.0.0-beta.8
ios-deploy version: Not installed
ios-sim version: 5.0.6 
OS: Mac OS X El Capitan
Node Version: v5.3.0
Xcode version: Xcode 7.2.1 Build version 7C1002
我已经将整个项目上传到gitHub上


请在config.xml中添加以下行

<allow-navigation href="*" />


希望这对你有帮助。谢谢。

请在config.xml中添加以下行

<allow-navigation href="*" />


希望这对你有帮助。谢谢。

我这样做了,这没有帮助:(我这样做了,这没有帮助):(调试器的错误日志中有哪些错误?调试器的错误日志中有哪些错误?