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
Try using a ref in your template instead:
And use the ref name as the argument:
@ViewChild('galleryContainer') galleryContainer: ElementRef;
EDIT
Forgot to mention that any view child thus declared is only available after the view is initialized. The first time this happens is in ngAfterViewInit
(import and implement the AfterViewInit
interface).
The ref name must not contain dashes or this will not work