【发布时间】:2016-11-24 12:21:51
【问题描述】:
作为 ionic 2 和 Trello REST 界面的新手,我需要帮助:
根据 Trello.com 网站 (https://developers.trello.com/get-started/start-building) 我有:
-
在 index.html 的 html 行下添加,即:在他们要求的正文之前,以下内容并替换了我的代码中的 AppKey:
< script src="http://code.jquery.com/jquery-1.7.1.min.js"></script> < script src="https://api.trello.com/1/client.js?key=[AppKey]"></script> -
根据他们的示例添加了添加卡片的代码:
var myList = 'myIDLIST';
var creationSuccess = function(data) { console.log('Card created successfully. Data returned:' + JSON.stringify(data)); }; var newCard = { name: 'New Test Card', desc: 'This is the description of our new card.', // Place this card at the top of our list idList: myList, pos: 'top' }; Trello.post('/cards/', newCard, creationSuccess);
但是我得到一个打字稿错误:
TypeScript error: C:/workspace/...etc..../service.ts(66,9): Error TS2304: Cannot find name 'Trello'.
我认为 Trello 应该可用于其他模块,因为它在 index.html 中声明
任何帮助表示赞赏。
【问题讨论】:
标签: rest post ionic2 trello typescript1.8