0
난 티타늄 appcelerator에 API를 처리 할 수 reste 라이브러리를 사용 :티타늄 appcelerator의 reste 수집
api.config({
debug : true,
autoValidateParams : false,
validatesSecureCertificate : false,
timeout : 4000,
url : Kb.baseUrl,
models: [{
name: "product",
id: "id",
//content: "retArray",
collections: [{
name: "products",
content: "response",
read: "get_products"
}],
}],
methods : [
{
name : "get_products",
post : "api/get_product"
}
],
...
그래서 내가 가져 오는 방법 (완벽하게 작동) :
var p = Alloy.Collections.get_products;
p.fetch({
success:function(m,r){
console.log(r)
}
});
이 내 설정이다
게시 할 개체가 있어야합니다 (작동하지 않는 이유는 무엇입니까?) :
p.fetch({
data:{'id':'2'},
success:function(m,r){ console.log(r); }
});
이 두 번째 가져 오기 기능이 작동하지 않습니다. 아이디어가 있습니까?
감사합니다.