BreezeJS如何跟踪属性更改 [英] How does BreezeJS track property changes

查看:93
本文介绍了BreezeJS如何跟踪属性更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇BreezeJS如何确定实体的哪些属性已更改并仍支持IE8?

I am curious about how BreezeJS is able to determine which properties of an entity have changed and still support IE8?

我正在建立的图书馆需要类似的功能. JavaScript设置器/获取器将是最简单的解决方案,但是IE8中的非dom对象不支持它们.

I am in the need of similar functionality for a library I am building. JavaScript setters/getters would be the easiest solution however they are not support on non-dom objects in IE8.

他们是否使用了类似的内容: https://gist.github.com/eligrey/384583:还是其他?

Are they using something like : https://gist.github.com/eligrey/384583 : or something else?

推荐答案

对于主干和剔除,它取决于使用的"modelLibrary",Breeze使用基础剔除或主干对象的可观察性".对于像AngularJS这样的东西,不需要底层对象支持可观察性,Breeze使用其"backingStore"模型库,该库与您在问题中指向的Object.watch实现非常相似.

It depends on the "modelLibrary" in use, for backbone and knockout Breeze uses the "observability" of the underlying knockout or backbone objects. For something like AngularJS, where there is no requirement for an underlying object to support observability, Breeze uses its "backingStore" model library which does something very similar to the Object.watch implementation that you are pointing to in your question.

"backingStore"实现(如上面的Object.watch实现)将无法在IE8上使用,因为不支持javascript"defineProperty".

The "backingStore" implementation, like the Object.watch implementation above will NOT work on IE8 because there is no support for javascripts "defineProperty".

希望这会有所帮助.

这篇关于BreezeJS如何跟踪属性更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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