Breezejs Double trouble in angularjs

前端 未结 5 1698
一整个雨季
一整个雨季 2021-01-20 14:46

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.

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-20 15:33

    Update 12 March

    I found what I believe is a better solution for your use case because it does not involve "debouncing" nor any change to Breeze. See the zEquivalent directive in this new plunker

    Reminder: the "best" resolution of the problem you discovered is still up in the air within the Breeze core team. You should not lock into a particular outcome until we can make a more definitive recommendation.

    p.s.: I should have mentioned that Jay and I are on the Breeze core team. We are doing our best to get you out of a jam but sometimes we move a wee too quickly. Bear with us please.

    This answer deprecated as of 12 March

    Leaving it here for "historical" purposes.

    I think you should try the zEquivalent directive first.

    It is important to know that the Angular team is working on a robust extension to data binding that includes "debounce" which is still a good idea for many scenarios. See this (long) pull request thread on the Angular GitHub site.

    Original Answer

    Consider the zDebounce directive currently located in this plunker which is based on @qorsmond's second attempt.

    I'd like to know your thoughts. I'm inclined to call this "the solution" and to add it to Breeze Labs. I'll update this answer when/if I do add it to the labs.

提交回复
热议问题