Do bindings nested inside of a lazy one-time ng-repeat binding bind just once?

后端 未结 1 1628
清酒与你
清酒与你 2020-12-12 12:16

My understand is that in the following code, both bindings will lazily bind only once:

  • {{::
  • 1条回答
    •  野趣味
      野趣味 (楼主)
      2020-12-12 12:27

      Scenario 1:

    • {{::item.name}}
    • Both expressions will be one-time bound. Adding an item or changing an existing item's name will not be reflected.

      Demo: http://plnkr.co/edit/53r8FCmcNK4MmM6Uzxp2?p=preview

      Scenario 2:

    • {{item.name}}
    • First expression will be one-time bound. Adding an item will not be reflected. Changing an existing item's name will be reflected.

      Demo: http://plnkr.co/edit/52wTEb8ze2FKRDDcS9Ow?p=preview

      Scenario 3:

    • {{thing.name}}
    • First expression will be one-time bound. Adding new item will not be reflected. Adding a new thing and changing existing thing's name will be reflected.

      Demo: http://plnkr.co/edit/HkObhkJtUnFEHBAzFUmN?p=preview

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