Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ember.js ember适配器url-按id模式查找-嵌套api资源_Ember.js_Ember Data_Ember Cli_Ember.js 2 - Fatal编程技术网

Ember.js ember适配器url-按id模式查找-嵌套api资源

Ember.js ember适配器url-按id模式查找-嵌套api资源,ember.js,ember-data,ember-cli,ember.js-2,Ember.js,Ember Data,Ember Cli,Ember.js 2,我有一个具有特定url结构的api。如何使用适配器或其他方法将ID传递给url字符串?只有一个模型,patient,但我需要查询这些项目中的每一个以及更多。我已经看到了可以将id放在url末尾的位置,但是我不确定如何为find查询构建额外的字符串。谢谢 获取:/api/v1/me/patients/{id} 获取:/api/v1/me/patients/{patient\u id}/public\u number 这就是模型中包含的内容: /models/patient.js export d

我有一个具有特定url结构的api。如何使用适配器或其他方法将ID传递给url字符串?只有一个模型,
patient
,但我需要查询这些项目中的每一个以及更多。我已经看到了可以将id放在url末尾的位置,但是我不确定如何为find查询构建额外的字符串。谢谢

获取:
/api/v1/me/patients/{id}

获取:
/api/v1/me/patients/{patient\u id}/public\u number

这就是模型中包含的内容:

/models/patient.js

export default DS.Model.extend({
    public_number:  DS.attr('string')
});

你可以调用
这个
,然后根据需要修改URL。你需要什么样的例子?你会这样问吗
this.store.queryRecord('patient',100157,'public_number')
找到了这个有用的资源。