2017-08-02 52 views
4

調用IO3D.services導致財產 '呼叫':無法讀取的不確定

Uncaught (in promise) TypeError: Cannot read property 'call' of undefined

版本: https://3d.io 1.0.0-beta.22(@Master#274adf0 2017年8月2日10:16)

我的嘗試:

IO3D.services.call('Model.search', { 
    arguments: { 
     organizationResourceId: <my_organisationResourceId>, 
     folderResourceName: '<my_folder_name>', 
    }, 
}).then(console.log) 

所以是服務的API尚未推向市場?

回答

1

到目前爲止,這是可以作爲一個實驗性的功能僅:

IO3D.utils.services.call('Model.search', { 
    arguments: { 
    organizationResourceName: 'template', 
    folderResourceName: 'default', 
    }, 
}).then(console.log) 

JsFddile:https://jsfiddle.net/3dio/ykut9gx1/

一旦脫離實驗階段的它在它自己的命名空間,我們可以作爲類似IO3D.scene.search(…)

+0

非常感謝!完美的作品。 試圖也使用'organizationResourceId'而不是'organizationResourceName'。 這也是panned? – meme

+0

好點!使用永久ID作爲參數肯定比使用可變名稱更堅實。我們會在我們的API設計中考慮這一點。 –