【发布时间】:2020-04-05 23:11:12
【问题描述】:
我正在尝试从一个简单的 api 获取数据,它在 ionic serve(browser) 中运行良好,但是当我构建应用程序时 http 调用不起作用。我的代码是
this.http.get("http://example.com/api/routes").subscribe(response => {
this.routes = response["routes"];
for (let x in this.routes) {
let a = this.routes[x].rou_stops;
let b = a.split(",");
for (let y in b) {
this.newCit.push(b[y]);
}
}
});
请帮助解决这个问题。
【问题讨论】:
-
任何运行时错误?
-
不,先生,没有运行时错误。
-
您的设备调试控制台是否出现任何错误?
-
没有先生@NajamUsSaqib,调试中没有任何错误
标签: angular typescript http ionic-framework ionic4