From 10bdb3baebded23eccd7698e07142636eacb748c Mon Sep 17 00:00:00 2001 From: ns-bot Date: Thu, 6 Jun 2019 13:04:17 +0300 Subject: [PATCH] chore: update 'listview' demo for nativescript-ui-listview v6.3.2 --- listview/package.json | 31 +++++++++---------- ...iew-data-operations-filtering.component.ts | 2 +- ...istview-group-swipe-load-pull.component.ts | 2 +- ...ations-grouping-collapsible.component.html | 2 +- ...erations-grouping-collapsible.component.ts | 2 -- .../grouping-scroll-to.component.ts | 2 +- .../with-header-footer.component.ts | 2 +- ...view-data-operations-grouping.component.ts | 2 +- ...stview-change-size-at-runtime.component.ts | 2 +- ...listview-item-layouts-runtime.component.ts | 8 ++--- ...w-item-selection-programmatic.component.ts | 10 +++--- ...d-size-auto-with-small-source.component.ts | 2 +- ...ultiple-operations-with-swipe.component.ts | 2 +- ...view-data-operations-multiple.component.ts | 2 +- ...iew-pull-to-refresh-customize.component.ts | 6 ++-- ...ew-scroll-to-index-horizontal.component.ts | 4 +-- ...iew-scroll-to-index-initial.component.html | 2 +- ...tview-scroll-to-index-initial.component.ts | 2 -- ...view-scroll-to-index-vertical.component.ts | 4 +-- ...tview-data-operations-sorting.component.ts | 2 +- ...stview-swipe-actions-multiple.component.ts | 10 +++--- ...view-swipe-actions-thresholds.component.ts | 4 +-- .../listview-swipe-actions.component.ts | 6 ++-- .../listview-swipe-disable.component.ts | 4 +-- .../navigation/options/options.component.ts | 8 ++--- 25 files changed, 58 insertions(+), 65 deletions(-) diff --git a/listview/package.json b/listview/package.json index f82c38d0..0cbeaa57 100644 --- a/listview/package.json +++ b/listview/package.json @@ -13,18 +13,17 @@ "readme": "README.md", "repository": "http://www.github.com/NativeScript/nativescript-ui-listview.git", "dependencies": { - "@angular/animations": "~7.2.0", - "@angular/common": "~7.2.0", - "@angular/compiler": "~7.2.0", - "@angular/core": "~7.2.0", - "@angular/forms": "~7.2.0", - "@angular/http": "~7.2.0", - "@angular/platform-browser": "~7.2.0", - "@angular/platform-browser-dynamic": "~7.2.0", - "@angular/router": "~7.2.0", - "nativescript-angular": "~7.2.0", - "nativescript-theme-core": "~1.0.4", + "@angular/animations": "~8.0.0", + "@angular/common": "~8.0.0", + "@angular/compiler": "~8.0.0", + "@angular/core": "~8.0.0", + "@angular/forms": "~8.0.0", + "@angular/platform-browser": "~8.0.0", + "@angular/platform-browser-dynamic": "~8.0.0", + "@angular/router": "~8.0.0", + "nativescript-angular": "~8.0.0", "nativescript-image": "~2.1.0", + "nativescript-theme-core": "~1.0.4", "nativescript-ui-listview": "*", "reflect-metadata": "~0.1.12", "rxjs": "~6.3.3", @@ -32,9 +31,6 @@ "zone.js": "~0.8.26" }, "devDependencies": { - "@angular/compiler-cli": "~7.2.0", - "@nativescript/schematics": "~0.5.0", - "@ngtools/webpack": "~7.2.0", "@types/chai": "^4.0.2", "@types/mocha": "^2.2.41", "@types/node": "^7.0.5", @@ -44,9 +40,10 @@ "mocha-multi": "^1.0.1", "mochawesome": "^3.1.1", "nativescript-dev-appium": "5.0.0", - "nativescript-dev-typescript": "~0.9.0", - "nativescript-dev-webpack": "~0.22.0", + "nativescript-dev-typescript": "~0.10.0", + "nativescript-dev-webpack": "~0.24.0", "tns-platform-declarations": "^5.4.1", - "tslint": "~5.11.0" + "tslint": "~5.11.0", + "typescript": "~3.4.5" } } diff --git a/listview/src/app/examples/filtering/listview-data-operations-filtering.component.ts b/listview/src/app/examples/filtering/listview-data-operations-filtering.component.ts index 6315df1c..697dcc5e 100644 --- a/listview/src/app/examples/filtering/listview-data-operations-filtering.component.ts +++ b/listview/src/app/examples/filtering/listview-data-operations-filtering.component.ts @@ -16,7 +16,7 @@ export class ListViewDataOperationsFilteringComponent implements OnInit { private _isEnabled: boolean; private _myFilteringFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { // >> listview-data-operations-filtering-angular diff --git a/listview/src/app/examples/group-swipe-load-pull/listview-group-swipe-load-pull.component.ts b/listview/src/app/examples/group-swipe-load-pull/listview-group-swipe-load-pull.component.ts index 76f37068..4dad7896 100644 --- a/listview/src/app/examples/group-swipe-load-pull/listview-group-swipe-load-pull.component.ts +++ b/listview/src/app/examples/group-swipe-load-pull/listview-group-swipe-load-pull.component.ts @@ -19,7 +19,7 @@ export class ListViewGroupSwipeLoadPullComponent implements OnInit { private _loadMoreItemsCount = 2; private _groupByDay: (item: any) => any; - @ViewChild("myListView") listViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) listViewComponent: RadListViewComponent; constructor(private _blogPostsService: BlogPostsService) { } diff --git a/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.html b/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.html index 67b89963..8bcc665f 100644 --- a/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.html +++ b/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.html @@ -1,5 +1,5 @@ - + diff --git a/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.ts b/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.ts index 3424acff..5ec85177 100644 --- a/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.ts +++ b/listview/src/app/examples/grouping-collapsible/listview-data-operations-grouping-collapsible.component.ts @@ -15,8 +15,6 @@ export class ListviewDataOperationsGroupingCollapsibleComponent implements OnIni private _dataItems: ObservableArray; private _myGroupingFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; - constructor(private _dataItemService: DataItemService) { this.myGroupingFunc = (item: DataItem) => { return item.category; diff --git a/listview/src/app/examples/grouping-scroll-to/grouping-scroll-to.component.ts b/listview/src/app/examples/grouping-scroll-to/grouping-scroll-to.component.ts index ae6341da..049d9b9f 100644 --- a/listview/src/app/examples/grouping-scroll-to/grouping-scroll-to.component.ts +++ b/listview/src/app/examples/grouping-scroll-to/grouping-scroll-to.component.ts @@ -16,7 +16,7 @@ export class ListViewDataOperationsGroupingScrollToComponent implements OnInit { private _isEnabled: boolean; private _myGroupingFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { this.myGroupingFunc = (item: DataItem) => { diff --git a/listview/src/app/examples/grouping-with-header-footer/with-header-footer.component.ts b/listview/src/app/examples/grouping-with-header-footer/with-header-footer.component.ts index 33126405..d3f312f4 100644 --- a/listview/src/app/examples/grouping-with-header-footer/with-header-footer.component.ts +++ b/listview/src/app/examples/grouping-with-header-footer/with-header-footer.component.ts @@ -16,7 +16,7 @@ export class ListViewDataOperationsGroupingHeaderFooterComponent implements OnIn private _isEnabled: boolean; private _myGroupingFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { this.myGroupingFunc = (item: DataItem) => { diff --git a/listview/src/app/examples/grouping/listview-data-operations-grouping.component.ts b/listview/src/app/examples/grouping/listview-data-operations-grouping.component.ts index 817b9b6b..ccc8e4f5 100644 --- a/listview/src/app/examples/grouping/listview-data-operations-grouping.component.ts +++ b/listview/src/app/examples/grouping/listview-data-operations-grouping.component.ts @@ -16,7 +16,7 @@ export class ListViewDataOperationsGroupingComponent implements OnInit { private _isEnabled: boolean; private _myGroupingFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { // >> listview-data-operations-grouping-angular diff --git a/listview/src/app/examples/header-footer/change-size-at-runtime/listview-change-size-at-runtime.component.ts b/listview/src/app/examples/header-footer/change-size-at-runtime/listview-change-size-at-runtime.component.ts index b9e31e33..6a6d5134 100644 --- a/listview/src/app/examples/header-footer/change-size-at-runtime/listview-change-size-at-runtime.component.ts +++ b/listview/src/app/examples/header-footer/change-size-at-runtime/listview-change-size-at-runtime.component.ts @@ -33,7 +33,7 @@ export class ListviewChangeSizeAtRuntimeComponent implements OnInit { }, 2000); } - @ViewChild("listView") listViewComponent: RadListViewComponent; + @ViewChild("listView", { read: RadListViewComponent, static: true }) listViewComponent: RadListViewComponent; get dataItems(): ObservableArray { return this._dataItems; diff --git a/listview/src/app/examples/item-layouts/listview-item-layouts-runtime.component.ts b/listview/src/app/examples/item-layouts/listview-item-layouts-runtime.component.ts index 54715881..4df54d4e 100644 --- a/listview/src/app/examples/item-layouts/listview-item-layouts-runtime.component.ts +++ b/listview/src/app/examples/item-layouts/listview-item-layouts-runtime.component.ts @@ -20,7 +20,7 @@ export class ListViewItemLayoutsRuntimeComponent implements OnInit { constructor(private _changeDetectionRef: ChangeDetectorRef, private _dataItemService: DataItemService) { } - @ViewChild("myListView") listViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; ngOnInit() { this._dataItems = new ObservableArray(this._dataItemService.getStaggeredItems()); @@ -33,7 +33,7 @@ export class ListViewItemLayoutsRuntimeComponent implements OnInit { public changeToLinear(args) { const layout = new ListViewLinearLayout(); - this.listViewComponent.listView.listViewLayout = layout; + this.myListViewComponent.listView.listViewLayout = layout; } public changeToGrid(args) { @@ -43,12 +43,12 @@ export class ListViewItemLayoutsRuntimeComponent implements OnInit { } layout.spanCount = 2; - this.listViewComponent.listView.listViewLayout = layout; + this.myListViewComponent.listView.listViewLayout = layout; } public changeToStaggered(args) { const layout = new ListViewStaggeredLayout(); layout.spanCount = 3; - this.listViewComponent.listView.listViewLayout = layout; + this.myListViewComponent.listView.listViewLayout = layout; } } \ No newline at end of file diff --git a/listview/src/app/examples/item-selection/listview-item-selection-programmatic.component.ts b/listview/src/app/examples/item-selection/listview-item-selection-programmatic.component.ts index 7ef8cf63..e4c9d7b1 100644 --- a/listview/src/app/examples/item-selection/listview-item-selection-programmatic.component.ts +++ b/listview/src/app/examples/item-selection/listview-item-selection-programmatic.component.ts @@ -20,7 +20,7 @@ export class ListViewItemSelectionProgrammaticComponent implements OnInit { constructor(private _dataItemService: DataItemService) { } - @ViewChild('myRadListView') listView: RadListViewComponent; + @ViewChild('myRadListView', { read: RadListViewComponent, static: false }) listViewComponent: RadListViewComponent; get dataItems(): ObservableArray { return this._dataItems; @@ -47,19 +47,19 @@ export class ListViewItemSelectionProgrammaticComponent implements OnInit { } public onSelectItemAtTap() { - this.listView.listView.selectItemAt(Number(this.txtSelectItemIndex)); + this.listViewComponent.listView.selectItemAt(Number(this.txtSelectItemIndex)); } public onDeselectItemAtTap() { - this.listView.listView.deselectItemAt(Number(this.txtDeselectItemIndex)); + this.listViewComponent.listView.deselectItemAt(Number(this.txtDeselectItemIndex)); } public onSelectAllTap() { - this.listView.listView.selectAll(); + this.listViewComponent.listView.selectAll(); } public onDeselectAllTap() { - this.listView.listView.deselectAll(); + this.listViewComponent.listView.deselectAll(); } } // << angular-listview-item-selection-programmatic-component diff --git a/listview/src/app/examples/load-on-demand/fixed-size-auto-with-small-source/listview-fixed-size-auto-with-small-source.component.ts b/listview/src/app/examples/load-on-demand/fixed-size-auto-with-small-source/listview-fixed-size-auto-with-small-source.component.ts index 73a8ef9a..a9010eee 100644 --- a/listview/src/app/examples/load-on-demand/fixed-size-auto-with-small-source/listview-fixed-size-auto-with-small-source.component.ts +++ b/listview/src/app/examples/load-on-demand/fixed-size-auto-with-small-source/listview-fixed-size-auto-with-small-source.component.ts @@ -26,7 +26,7 @@ export class ListViewFixedSizeAutoWithSmallSourceComponent implements OnInit { this._allItems = serverPeopleCollection.people.slice(); } - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: true }) myListViewComponent: RadListViewComponent; ngOnInit() { this.layout = new ListViewLinearLayout(); diff --git a/listview/src/app/examples/multiple-operations-with-swipe/listview-multiple-operations-with-swipe.component.ts b/listview/src/app/examples/multiple-operations-with-swipe/listview-multiple-operations-with-swipe.component.ts index 758af89f..7e8e23af 100644 --- a/listview/src/app/examples/multiple-operations-with-swipe/listview-multiple-operations-with-swipe.component.ts +++ b/listview/src/app/examples/multiple-operations-with-swipe/listview-multiple-operations-with-swipe.component.ts @@ -24,7 +24,7 @@ export class ListViewDataOperationsMultipleWithSwipeComponent implements OnInit private _mySortingFunc: (item: any, otherItem: any) => number; private _myFilteringFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { this.myGroupingFunc = (item: DataItem) => { diff --git a/listview/src/app/examples/multiple-operations/listview-data-operations-multiple.component.ts b/listview/src/app/examples/multiple-operations/listview-data-operations-multiple.component.ts index c1f8d2ae..592fa7dc 100644 --- a/listview/src/app/examples/multiple-operations/listview-data-operations-multiple.component.ts +++ b/listview/src/app/examples/multiple-operations/listview-data-operations-multiple.component.ts @@ -22,7 +22,7 @@ export class ListViewDataOperationsMultipleComponent implements OnInit { private _mySortingFunc: (item: any, otherItem: any) => number; private _myFilteringFunc: (item: any) => any; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { this.myGroupingFunc = (item: DataItem) => { diff --git a/listview/src/app/examples/pull-to-refresh/customize/listview-pull-to-refresh-customize.component.ts b/listview/src/app/examples/pull-to-refresh/customize/listview-pull-to-refresh-customize.component.ts index b6df4bce..5ac6de1e 100644 --- a/listview/src/app/examples/pull-to-refresh/customize/listview-pull-to-refresh-customize.component.ts +++ b/listview/src/app/examples/pull-to-refresh/customize/listview-pull-to-refresh-customize.component.ts @@ -22,16 +22,16 @@ export class ListViewPullToRefreshCustomizeComponent implements OnInit { constructor(private _changeDetectionRef: ChangeDetectorRef) { } - @ViewChild("listView") listViewComponent: RadListViewComponent; + @ViewChild("listView", { read: RadListViewComponent, static: true }) myListViewComponent: RadListViewComponent; ngOnInit() { this.initDataItems(); this._changeDetectionRef.detectChanges(); - if (this.listViewComponent && this.listViewComponent.listView) { + if (this.myListViewComponent && this.myListViewComponent.listView) { let style = new PullToRefreshStyle(); style.indicatorColor = new Color("red"); style.indicatorBackgroundColor = new Color("blue"); - this.listViewComponent.listView.pullToRefreshStyle = style; + this.myListViewComponent.listView.pullToRefreshStyle = style; } } diff --git a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-horizontal.component.ts b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-horizontal.component.ts index 4f055187..76e033d7 100644 --- a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-horizontal.component.ts +++ b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-horizontal.component.ts @@ -36,7 +36,7 @@ export class ListViewScrollToIndexHorizontalComponent extends OptionsExampleBase this.set("myScrollPosition", this._options[selectedIndex]); } - @ViewChild('myRadListView') listViewComponent: RadListViewComponent; + @ViewChild('myRadListView', { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; get dataItems(): ObservableArray { return this._dataItems; @@ -47,7 +47,7 @@ export class ListViewScrollToIndexHorizontalComponent extends OptionsExampleBase } public onTap() { - this.listViewComponent.listView.scrollToIndex(50, false, this.get('myScrollPosition')); + this.myListViewComponent.listView.scrollToIndex(50, false, this.get('myScrollPosition')); } public onNavigatingTo(args) { diff --git a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.html b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.html index fbeca8ba..c8c29120 100644 --- a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.html +++ b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.html @@ -1,6 +1,6 @@ - + diff --git a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.ts b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.ts index 21ed0004..de6cf093 100644 --- a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.ts +++ b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-initial.component.ts @@ -28,8 +28,6 @@ export class ListViewScrollToIndexInitialComponent extends OptionsExampleBase im super(); } - @ViewChild('myRadListView') listViewComponent: RadListViewComponent; - get dataItems(): ObservableArray { return this._dataItems; } diff --git a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-vertical.component.ts b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-vertical.component.ts index 9a1a772f..a64a0787 100644 --- a/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-vertical.component.ts +++ b/listview/src/app/examples/scroll-to-index/listview-scroll-to-index-vertical.component.ts @@ -39,10 +39,10 @@ export class ListViewScrollToIndexVerticalComponent extends OptionsExampleBase i } // >> angular-listview-scroll-to-index - @ViewChild('myRadListView') listViewComponent: RadListViewComponent; + @ViewChild('myRadListView', { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; public onTap() { - this.listViewComponent.listView.scrollToIndex(50, false, this.get('myScrollPosition')); + this.myListViewComponent.listView.scrollToIndex(50, false, this.get('myScrollPosition')); } // << angular-listview-scroll-to-index diff --git a/listview/src/app/examples/sorting/listview-data-operations-sorting.component.ts b/listview/src/app/examples/sorting/listview-data-operations-sorting.component.ts index c02dafac..8d5bfa72 100644 --- a/listview/src/app/examples/sorting/listview-data-operations-sorting.component.ts +++ b/listview/src/app/examples/sorting/listview-data-operations-sorting.component.ts @@ -22,7 +22,7 @@ export class ListViewDataOperationsSortingComponent implements OnInit { private _isEnabled: boolean; private _mySortingFunc: (item: any, otherItem: any) => number; - @ViewChild("myListView") myListViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; constructor(private _dataItemService: DataItemService) { // >> listview-data-operations-sorting-angular diff --git a/listview/src/app/examples/swipe-actions/listview-swipe-actions-multiple.component.ts b/listview/src/app/examples/swipe-actions/listview-swipe-actions-multiple.component.ts index 60f9ec34..dbf45c99 100644 --- a/listview/src/app/examples/swipe-actions/listview-swipe-actions-multiple.component.ts +++ b/listview/src/app/examples/swipe-actions/listview-swipe-actions-multiple.component.ts @@ -28,7 +28,7 @@ export class ListViewSwipeActionsMultipleComponent implements OnInit { return this._dataItems; } - @ViewChild("myListView") listViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; ngOnInit() { this._dataItems = new ObservableArray(this._dataItemService.getPostDataItems()); @@ -98,13 +98,13 @@ export class ListViewSwipeActionsMultipleComponent implements OnInit { public onLeftSwipeClick(args: EventData) { let itemView = args.object as View; - console.log("Button clicked: " + itemView.id + " for item with index: " + this.listViewComponent.listView.items.indexOf(itemView.bindingContext)); - this.listViewComponent.listView.notifySwipeToExecuteFinished(); + console.log("Button clicked: " + itemView.id + " for item with index: " + this.myListViewComponent.listView.items.indexOf(itemView.bindingContext)); + this.myListViewComponent.listView.notifySwipeToExecuteFinished(); } public onRightSwipeClick(args: EventData) { let itemView = args.object as View; - console.log("Button clicked: " + itemView.id + " for item with index: " + this.listViewComponent.listView.items.indexOf(itemView.bindingContext)); - this.listViewComponent.listView.notifySwipeToExecuteFinished(); + console.log("Button clicked: " + itemView.id + " for item with index: " + this.myListViewComponent.listView.items.indexOf(itemView.bindingContext)); + this.myListViewComponent.listView.notifySwipeToExecuteFinished(); } } \ No newline at end of file diff --git a/listview/src/app/examples/swipe-actions/listview-swipe-actions-thresholds.component.ts b/listview/src/app/examples/swipe-actions/listview-swipe-actions-thresholds.component.ts index 545269b4..32b20256 100644 --- a/listview/src/app/examples/swipe-actions/listview-swipe-actions-thresholds.component.ts +++ b/listview/src/app/examples/swipe-actions/listview-swipe-actions-thresholds.component.ts @@ -26,7 +26,7 @@ export class ListViewSwipeActionsThresholdsComponent implements OnInit { return this._dataItems; } - @ViewChild("myListView") listViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; ngOnInit() { this._dataItems = new ObservableArray(this._dataItemService.getPostDataItems()); @@ -96,7 +96,7 @@ export class ListViewSwipeActionsThresholdsComponent implements OnInit { public onLeftSwipeClick(args: ListViewEventData) { console.log("Left swipe click"); - this.listViewComponent.listView.notifySwipeToExecuteFinished(); + this.myListViewComponent.listView.notifySwipeToExecuteFinished(); } public onRightSwipeClick(args) { diff --git a/listview/src/app/examples/swipe-actions/listview-swipe-actions.component.ts b/listview/src/app/examples/swipe-actions/listview-swipe-actions.component.ts index f5e8dd62..55125d3b 100644 --- a/listview/src/app/examples/swipe-actions/listview-swipe-actions.component.ts +++ b/listview/src/app/examples/swipe-actions/listview-swipe-actions.component.ts @@ -25,7 +25,7 @@ export class ListViewSwipeActionsComponent implements OnInit { return this._dataItems; } - @ViewChild("myListView") listViewComponent: RadListViewComponent; + @ViewChild("myListView", { read: RadListViewComponent, static: false }) myListViewComponent: RadListViewComponent; ngOnInit() { this._dataItems = new ObservableArray(this._dataItemService.getPostDataItems()); @@ -64,7 +64,7 @@ export class ListViewSwipeActionsComponent implements OnInit { // >> angular-listview-swipe-action-handlers public onLeftSwipeClick(args: ListViewEventData) { console.log("Left swipe click"); - this.listViewComponent.listView.notifySwipeToExecuteFinished(); + this.myListViewComponent.listView.notifySwipeToExecuteFinished(); } public onRightSwipeClick(args) { @@ -76,7 +76,7 @@ export class ListViewSwipeActionsComponent implements OnInit { public onLayoutTap(args) { const message = "Tap on Layout for item: " + (args.object.bindingContext).name; console.log(message); - this.listViewComponent.listView.notifySwipeToExecuteFinished(); + this.myListViewComponent.listView.notifySwipeToExecuteFinished(); let lbl =