2017-08-02 58 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设计中考虑这一点。 –