Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/415.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
Javascript 对breeze中返回结果的查询_Javascript_Breeze - Fatal编程技术网

Javascript 对breeze中返回结果的查询

Javascript 对breeze中返回结果的查询,javascript,breeze,Javascript,Breeze,我想查询返回的结果,但当我使用以下代码时,它会抛出一个错误: let em=new breeze.EntityManager('api/customer'); 让serverQuery=breeze.EntityQuery.from('Customer'); 让localQuery=breeze.EntityQuery.from('Customer')。其中('Id','1'); em.executeQuery(服务器查询) 。然后(数据=>{ 让localData=data.entityMa

我想查询返回的结果,但当我使用以下代码时,它会抛出一个错误:

let em=new breeze.EntityManager('api/customer');
让serverQuery=breeze.EntityQuery.from('Customer');
让localQuery=breeze.EntityQuery.from('Customer')。其中('Id','1');
em.executeQuery(服务器查询)
。然后(数据=>{
让localData=data.entityManager.ExecuteQueryLocal(localQuery);//错误
})
.catch(错误=>{
console.log(错误);

});好的,我不知道这是否是最好的方法,但这段代码似乎有效:

let em=new breeze.EntityManager('api/customer');
让serverQuery=breeze.EntityQuery.from('Customer').toType('Customer');
em.executeQuery(服务器查询)
。然后(数据=>{
让localData=data.query.where('id','=','1')。使用(em.executeloly();//工作!
})
.catch(错误=>{
console.log(错误);
});