(index?: number)
| 637 | } |
| 638 | |
| 639 | override remove(index?: number): void { |
| 640 | const adjustedIdx = this._adjustIndex(index, -1); |
| 641 | const detachedView = detachView(this._lContainer, adjustedIdx); |
| 642 | |
| 643 | if (detachedView) { |
| 644 | // Before destroying the view, remove it from the container's array of `ViewRef`s. |
| 645 | // This ensures the view container length is updated before calling |
| 646 | // `destroyLView`, which could recursively call view container methods that |
| 647 | // rely on an accurate container length. |
| 648 | // (e.g. a method on this view container being called by a child directive's OnDestroy |
| 649 | // lifecycle hook) |
| 650 | removeFromArray(getOrCreateViewRefs(this._lContainer), adjustedIdx); |
| 651 | destroyLView(detachedView[TVIEW], detachedView); |
| 652 | } |
| 653 | } |
| 654 | |
| 655 | override detach(index?: number): ViewRef | null { |
| 656 | const adjustedIdx = this._adjustIndex(index, -1); |
no test coverage detected