Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6f7549

Browse files
committed
fix(list-view): Do not access destroyed items' ng views.
1 parent fa089aa commit c6f7549

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎nativescript-angular/directives/list-view-comp.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export class ListViewComponent implements DoCheck, OnDestroy, AfterContentInit {
158158
items.getItem(index) : items[index];
159159
let viewRef: EmbeddedViewRef<ListItemContext>;
160160

161-
if (args.view) {
161+
if (args.view&&args.view[NG_VIEW]) {
162162
listViewLog("onItemLoading: " + index + " - Reusing existing view");
163163
viewRef = args.view[NG_VIEW];
164164
// getting angular view from original element (in cases when ProxyViewContainer
@@ -245,6 +245,7 @@ export function getItemViewRoot(viewRef: ComponentView, rootLocator: RootLocator
245245
const rootView = rootLocator(viewRef.rootNodes, 0);
246246
rootView.on("unloaded", () => {
247247
viewRef.destroy();
248+
delete rootView[NG_VIEW];
248249
});
249250
return rootView;
250251
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /