DEV Community

Discussion on: How to Implement Animate on Scroll in Angular Web Apps - Using the AOS Library

 
olabima_ profile image
Bima This is Angular

Alright try this please:

// 1) import PLATFORM_ID from '@angular/core', eg:
import {  PLATFORM_ID } from '@angular/core';

// 2) Inject in the component constructor where you have to init the AOS, eg:

constructor( @Inject(PLATFORM_ID) private platformId: Object)

// 3) Wrap the AOS.init with this if statement, eg:

 if (isPlatformBrowser(this.platformId)) { AOS.init(); })
Enter fullscreen mode Exit fullscreen mode

Please give feedback thanks