ember-data:如何判断模型的异步:真实关系是否加载而不触发负载? [英] ember-data: How to tell if a model's async: true relationship is loaded without triggering a load?

查看:89
本文介绍了ember-data:如何判断模型的异步:真实关系是否加载而不触发负载?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检查一个异步关系是否已加载而不触发负载,这是可能的吗?

I need to check if an async relationship has been loaded without triggering the load, is this possible?

推荐答案

没有正式的方法来完成这个,但是非官方地你可以做

There is no official way to accomplish this yet, but unofficially you can do

// this will be null if not loaded, and populated if it has at least started loading
if(model._relationships.yourRelationshipName) {...}

这篇关于ember-data:如何判断模型的异步:真实关系是否加载而不触发负载?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆