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

当我运行离子模仿IOS,这个程序不会让任何Ajax调用

当我运行离子模仿IOS -c -l这个应用程序完美的作品

这是我的供应商类我几乎完全从离子会议应用复制

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上

2016-04-08

alyn000r

+0

调试器的错误日志中有哪些错误? –

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值