Skip to content

Strange behavior on properties. #271

@tomyo

Description

@tomyo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions