The interpolated values get applied to the span text content of all ngfor elements

后端 未结 1 796
無奈伤痛
無奈伤痛 2021-01-26 10:46

I am retrieving the moved element top and left values and displaying it within the element, the issue is the top, left values of the current moved element modifies the span text

1条回答
  •  隐瞒了意图╮
    2021-01-26 11:42

    The problem is that you are binding to a property that is for the entire scope of the page.

    {{left}}
    

    Instead, I'd make existingDroppedItemZoneIn a type with properties:

    existingDroppedItemZoneIn[]: DropBox[] = new {[
       {left:0, top:0},
       {left:20, top: 0}
    ]};
    

    And then you would want to bind to each box's attributes:

    {{ box.dis }} {{box.left}} {{box.top}}

    And this is a quick pseudo-code example. So it likely isn't perfect.

    0 讨论(0)
提交回复
热议问题