Skip to content

Commit 148b31d

Browse files
author
VladimirAmiorkov
committed
chore: update deprecated angular API in demo apps
1 parent 28d262d commit 148b31d

File tree

8 files changed

+11
-12
lines changed

8 files changed

+11
-12
lines changed

Diff for: e2e/animation-examples/app/animation-builder.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import { Component, ViewChild } from '@angular/core';
77
`
88
})
99
export class AnimationBuilderComponent {
10-
@ViewChild('button')
11-
private button;
10+
@ViewChild('button', { static: false }) button;
1211

1312
constructor(private _builder: AnimationBuilder) {}
1413

Diff for: e2e/modal-navigation-ng/app/navigation/basic.navigation.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import { ModalViewComponent } from "~/modal-shared/modal-view.component";
2323

2424
export class BasicsNavigationComponent {
2525

26-
@ViewChild("popoverButtonComp") popoverButtonComp: ElementRef;
26+
@ViewChild("popoverButtonComp", { read: ElementRef, static: false }) popoverButtonComp: ElementRef;
2727
@Input() col: number;
2828
constructor(
2929
private modal: ModalDialogService,

Diff for: e2e/nested-router-tab-view/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { NSLocationStrategy } from "nativescript-angular/router/ns-location-stra
1212
export class AppComponent {
1313
private isInitialNavigation = true;
1414

15-
@ViewChild(TabViewDirective) tabView: TabViewDirective;
15+
@ViewChild(TabViewDirective, { read: TabViewDirective, static: false }) tabView: TabViewDirective;
1616

1717
constructor(router: Router, location: NSLocationStrategy) {
1818
router.events.subscribe(e => {

Diff for: e2e/router-tab-view/app/app.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { NSLocationStrategy } from "nativescript-angular/router/ns-location-stra
1212
export class AppComponent {
1313
private isInitialNavigation = true;
1414

15-
@ViewChild(TabViewDirective) tabView: TabViewDirective;
15+
@ViewChild(TabViewDirective, { read: TabViewDirective, static: false }) tabView: TabViewDirective;
1616

1717
constructor(router: Router, location: NSLocationStrategy) {
1818
router.events.subscribe(e => {

Diff for: tests/app/tests/detached-loader-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class TestComponent { }
1010

1111

1212
class LoaderComponentBase {
13-
@ViewChild(DetachedLoader) public loader: DetachedLoader;
13+
@ViewChild(DetachedLoader, { read: DetachedLoader, static: false }) public loader: DetachedLoader;
1414
}
1515

1616
@Component({

Diff for: tests/app/tests/list-view-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class TestDefaultItemTemplateComponent {
9393
this.myItems.push(new DataItem(i, "Name " + i));
9494
}
9595
}
96-
@ViewChild("listView") listViewElement: ListViewComponent;
96+
@ViewChild("listView", { read: ListViewComponent, static: false }) listViewElement: ListViewComponent;
9797
onScrollListViewTo() {
9898
this.listViewElement.nativeElement.scrollToIndex(100);
9999
}

Diff for: tests/app/tests/renderer-tests.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ registerElement("ButtonCounter", () => ButtonCounter);
222222
}`]
223223
})
224224
export class NgControlSettersCount {
225-
@ViewChild("btn1") btn1: ElementRef;
226-
@ViewChild("btn2") btn2: ElementRef;
227-
@ViewChild("btn3") btn3: ElementRef;
228-
@ViewChild("btn3") btn4: ElementRef;
225+
@ViewChild("btn1", { read: ElementRef, static: false }) btn1: ElementRef;
226+
@ViewChild("btn2", { read: ElementRef, static: false }) btn2: ElementRef;
227+
@ViewChild("btn3", { read: ElementRef, static: false }) btn3: ElementRef;
228+
@ViewChild("btn3", { read: ElementRef, static: false }) btn4: ElementRef;
229229

230230
get buttons(): ElementRef[] { return [this.btn1, this.btn2, this.btn3, this.btn4]; }
231231

Diff for: tests/app/tests/router-module-tests.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { NSRouteReuseStrategy } from "nativescript-angular/router/ns-route-reuse
1313
template: `<StackLayout><Label nsRouterLink text="COMPONENT"></Label></StackLayout>`
1414
})
1515
class RouterTestComponent {
16-
@ViewChild(NSRouterLink)
16+
@ViewChild(NSRouterLink, { read: NSRouterLink, static: false })
1717
nsRouterLink: NSRouterLink;
1818
}
1919

0 commit comments

Comments
 (0)