Breezejs在angularjs双重麻烦 [英] Breezejs Double trouble in angularjs

查看:200
本文介绍了Breezejs在angularjs双重麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从整数一个角度视图改变值被绑定到ngmodel浮点/双精度值。输入不除除整数以外的任何其他。

I am trying to change a value in a angular view from a integer to a float/double value that is bind to ngmodel. The input don’t except anything other than a integer.

我的猜测是,清风做了在后台验证的定义的属性的价值或什么的。但我的JavaScript原型的知识是非常有限又名我需要学习它..

My guess is that breeze does something in the background to validate the value or something on the "defined properties". But my knowledge of JavaScript prototyping is very limiting aka I need to learn it..

这是真的很难解释,所以我创建了一个普拉克能希望能帮助: HTTP :?//plnkr.co/edit/Gcj0VvBE3f8DRbIjMtqt p = preVIEW

This is really hard to explain so I created a plunk that can hopefully help: http://plnkr.co/edit/Gcj0VvBE3f8DRbIjMtqt?p=preview

在普拉克我还添加了一个普通对象来测试相同的价值观,它正在改变号码时,花车如预期/双打。

In the plunk I also added a normal object to test the same values and it is working as expected when changing the numbers to floats/doubles.

所以,问题是,为什么不会值改变从微风绑定到一个浮点/双精度值当?

So the question is why won’t the value changed when binding to a float/double value from breeze?

推荐答案

我查了preliminary修复到GitHub的这一点。请检查出来,让我知道,如果它的工作原理(或没有)。我们仍在测试。

I've checked a preliminary fix into GitHub for this. Please check it out and let me know if it works ( or not). We are still testing it.

此问题是由角的(新)的行为,如果角消化周期不会看到更改模型属性在那里,然后它似乎在UI重置为它是在previous消化周期引起的。所以..此修复程序背后的想法是说服角度,该模型的价值已经改变它甚至没有当。

This issue is caused by Angular's (new) behavior where if the angular digest cycle does not see a change to a model property then it seems to reset the UI to what it was on the previous digest cycle. So.. the idea behind this fix is to convince angular that the model value has changed even when it hasn’t.

和..不错赶上(这不是明显,你plunkr帮助):)

and.. nice catch ( this was not obvious and your plunkr helped) :)

沃德补充说:你必须爱微风团队响应:-)周杰伦跃升权就这个问题和一个有趣的解决方案上来。但是请注意这个词的 preliminary 在周杰伦的答案。我们正在讨论这个修复内,它可能被收回。考虑 zEquivalent 在这个新plunker 或只是等待,直到尘埃落定。

Ward adds: You must love the breeze team responsiveness :-) Jay jumped right on this and came up with an interesting solution. But please note the word "preliminary" in Jay's answer. We are discussing this "fix" internally and it may be withdrawn. Consider the zEquivalent directive in this new plunker or just wait until the dust settles.

这篇关于Breezejs在angularjs双重麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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