We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1eece50 commit 41b8d95Copy full SHA for 41b8d95
1 file changed
modules/@angular/core/src/linker/view_container_ref.ts
@@ -186,7 +186,8 @@ export class ViewContainerRef_ implements ViewContainerRef {
186
}
187
188
indexOf(viewRef: ViewRef): number {
189
- return this._element.nestedViews.indexOf((<ViewRef_<any>>viewRef).internalView);
+ return this.length ? this._element.nestedViews.indexOf((<ViewRef_<any>>viewRef).internalView) :
190
+ -1;
191
192
193
/** @internal */
@@ -213,7 +214,7 @@ export class ViewContainerRef_ implements ViewContainerRef {
213
214
return wtfLeave(s, view.ref);
215
216
- clear() {
217
+ clear(): void {
218
for (let i = this.length - 1; i >= 0; i--) {
219
this.remove(i);
220
0 commit comments