(index?: number)
| 614 | } |
| 615 | |
| 616 | override remove(index?: number): void { |
| 617 | const adjustedIdx = this._adjustIndex(index, -1); |
| 618 | const detachedView = detachView(this._lContainer, adjustedIdx); |
| 619 | |
| 620 | if (detachedView) { |
| 621 | // Before destroying the view, remove it from the container's array of `ViewRef`s. |
| 622 | // This ensures the view container length is updated before calling |
| 623 | // `destroyLView`, which could recursively call view container methods that |
| 624 | // rely on an accurate container length. |
| 625 | // (e.g. a method on this view container being called by a child directive's OnDestroy |
| 626 | // lifecycle hook) |
| 627 | removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx); |
| 628 | destroyLView(detachedView[TVIEW], detachedView); |
| 629 | } |
| 630 | } |
| 631 | |
| 632 | override detach(index?: number): ViewRef | null { |
| 633 | const adjustedIdx = this._adjustIndex(index, -1); |
no test coverage detected