commit eb0ab228e1c28ea4d7e4087e1a0975f90e1e324f
parent fd9df102bf15e69f00572c02e74470ff5759562c
Author: MTRNord <mtrnord1@gmail.com>
Date: Sun, 18 Mar 2018 18:30:27 +0100
Try to find out the correct type
Diffstat:
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/app/tweet-list/tweet-list.component.ts b/src/app/tweet-list/tweet-list.component.ts
@@ -1,4 +1,4 @@
-import {Component, Input, OnInit, ViewChildren} from '@angular/core';
+import {Component, ElementRef, Input, OnInit, QueryList} from '@angular/core';
import * as Raven from 'raven-js';
import {ApiService, TweetsEntity} from '../api.service';
import {Observable} from 'rxjs/Observable';
@@ -31,11 +31,11 @@ export class TweetListComponent implements OnInit {
});
}
- public goTo(el: HTMLElement[], which: string): void {
- el.forEach((value: HTMLElement, index: number, array: HTMLElement[]) => {
- if (value.id === which) {
+ public goTo(el: QueryList<ElementRef>, which: string): void {
+ el.toArray().forEach((value: ElementRef, index: number, array: ElementRef[]) => {
+ if (value.nativeElement.id === which) {
console.log(value);
- value.scrollIntoView();
+ value.nativeElement.scrollIntoView();
}
});
}