codemonkeychris/angular-winjs — pull request #38 by spankyj (2014-06-14 05:02:29+00:00)
Title: Fixing issue #28. The usage of repeaters within hub sections and pivot i...

Fixing issue #28. The usage of repeaters within hub sections and pivot tems introduces some

interesting issues, these issues are induced initially by the fact that angular repeaters are
asynchronous but even some mechanism for addressing that for the initial render would not have
fixed the problem of enabling Hubs and Pivots to work with the changes that a repeater can support.

After thinking it over a while I think I have come of up with a reasonable solution. In this
solution I have the PivotItem and HubSection directives wrap the actual control instance in a
placeholder and then have Pivot and Hub support a dummy element which is the host for these
placeholders. This allows the ng-repeat to manage the placeholders without always attempting to
steal nodes out of the Hub/Pivot and re-parenting them, this has the added benefit of being the
truth with regards to what index a given Item/Section are.

Then we explicitly expose a controller from the Hub/Pivot to the Section/Item which enable add and
remove to be specific operations that be performed in the link function for the Section/Item.