Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange behavior on properties. #271

Open
tomyo opened this issue Sep 2, 2016 · 1 comment
Open

Strange behavior on properties. #271

tomyo opened this issue Sep 2, 2016 · 1 comment

Comments

@tomyo
Copy link

tomyo commented Sep 2, 2016

I'll just paste the self-explained code below:
P.S. I tried setting a new value instead of using reset(), same strange behavior.

Template.cartItem.viewmodel
  shippingPrice: undefined
  updateShippingPrice: ->
    if @ship() and not @outOfStock()
      Meteor.call 'calculateShipingPrice', @productId(), (error, result) =>
        if error
          FF.helpers.showInternalError error
        else
          @shippingPrice result
    else
      @shippingPrice.reset()
      @shippingPrice()  # FIXME: Why doesn't work without this line?
                        # shippingPrice doesn't update if I don't ask for it's value now
@ManuelDeLeon
Copy link
Owner

I don't understand the problem. Please make a minimal repro, preferably
without Meteor calls and anything not germane to the problem.

Thanks.

On Sep 2, 2016 1:22 PM, "Tomas Hayes" [email protected] wrote:

I'll just paste the self-explained code below:
P.S. I tried setting a new value instead of using reset(), same strange
behavior.

Template.cartItem.viewmodel
shippingPrice: undefined
updateShippingPrice: ->
if @Ship() and not @outofstock()
Meteor.call 'calculateShipingPrice', @ProductID(), (error, result) =>
if error
FF.helpers.showInternalError error
else
@shippingPrice result
else
@shippingPrice.reset()
@shippingPrice() # FIXME: Why doesn't work without this line?
# shippingPrice doesn't update if I don't ask for it's value now


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#271, or mute the thread
https://github.com/notifications/unsubscribe-auth/AED31qdnOFh1-bR_GTcvYsF1QGpVni3Lks5qmHU-gaJpZM4J0AZu
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants