I\'ve looked at several related posts and documentation, but still can\'t seem to get expected behavior from @ViewChild.
Ultimately, I\'m trying to set the scroll p
Another possible scenario is when you are using typescript in angular or ionic framework and calling the ViewChild element from a function having javascript like signature. Please use a typescript like function signature instead (e.g. using fat arrow =>). For example
accessViewChild(){
console.log(this.galleryContainer.nativeElement.innerHTML);
}
would show print undefined however
accessViewChild = ()=>{
console.log(this.galleryContainer.nativeElement.innerHTML);
}
would print the inner html.