0

我想设置我的 Ionic2 应用程序以使用 Backand SDK。我是 Ionic2 / Angular2 的新手,我找不到任何带有 Ionic2 应用程序的示例。我只能找到对我没有帮助的带有 Ionic1 / Angular1 应用程序的示例应用程序。

有什么线索吗?

谢谢,纪尧姆

4

1 回答 1

2

正如 Aaron 所说,您可以从我的存储库中的 /app/service 文件夹中获取“backandService.ts”文件

https://github.com/backand/ionic2-crud-example

在这里,您可以直接链接到文件。

如果您使用的是 Typescript,您将能够使用以下代码段加载它:

import {BackandService} from '../../services/backandService'

在构造函数中注入 BackandService:

constructor(public backandService:BackandService) {   
}

并像这样登录:

this.backandService.getAuthTokenSimple(this.username, this.password);

然后使用以下代码发布数据:

this.backandService.postItem(this.name)
于 2016-05-05T07:36:56.877 回答