小编use*_*998的帖子

SiriKit付款确认货币始终为美元

我构建Intents扩展,我正在处理INSendMoneyIntent,我说:

送25欧元给约翰史密斯

应用程序确认后的响应

这是您的<Your_App>付款,价格为25.00美元.你想发送吗?

Intent包含正确的货币iso 3代码 - EUR,那么为什么siri在付款确认中显示错误的货币?

回归意图

INSendPaymentIntentResponse *reponse = [[INSendPaymentIntentResponse alloc] initWithCode:INSendPaymentIntentResponseCodeReady userActivity:userActivity];
completion(reponse);
Run Code Online (Sandbox Code Playgroud)

ios ios10 sirikit intents-extension

6
推荐指数
1
解决办法
994
查看次数

自动将JSON对象映射到TypeScript对象(Angular 2)

我是Typescript和javascript的新手.我的问题是:怎么做到这一点

```

{
    "release": {
        "ref": {},
        "commits": {}
    },
    "debug": {
        "ref": {},
        "commits": {}
    },
    "feature": {
        "ref": {},
        "commits": {}
    },
    "hotfix": {
        "ref": {},
        "commits": {}
    }
}
Run Code Online (Sandbox Code Playgroud)

```

使用接口使用Typescript映射它

export interface IRepo { branches: IBranch; // how to make branches a of type string: IBranch dictionary? }

将有未知数量的属性,如调试,发布等,我想在IRepo实例中将它们保留为字典

我正在使用它来获取数据:

```

getRepo() : Observable<IRepo> {
    if (!this.repo) {
        return this.http.get(this._baseUrl + 'repo.json')
            .map((res: Response) => {
                this.repo = res.json();
                return this.repo;
                })
                .catch(this.handleError);
    } else { …
Run Code Online (Sandbox Code Playgroud)

json dictionary typescript angular2-services

4
推荐指数
1
解决办法
1623
查看次数