(index?: number)
| 591 | } |
| 592 | |
| 593 | override remove(index?: number): void { |
| 594 | const adjustedIdx = this._adjustIndex(index, -1); |
| 595 | const detachedView = detachView(this._lContainer, adjustedIdx); |
| 596 | |
| 597 | if (detachedView) { |
| 598 | // Before destroying the view, remove it from the container's array of `ViewRef`s. |
| 599 | // This ensures the view container length is updated before calling |
| 600 | // `destroyLView`, which could recursively call view container methods that |
| 601 | // rely on an accurate container length. |
| 602 | // (e.g. a method on this view container being called by a child directive's OnDestroy |
| 603 | // lifecycle hook) |
| 604 | removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx); |
| 605 | destroyLView(detachedView[TVIEW], detachedView); |
| 606 | } |
| 607 | } |
| 608 | |
| 609 | override detach(index?: number): ViewRef | null { |
| 610 | const adjustedIdx = this._adjustIndex(index, -1); |
no test coverage detected