1

I am not able to import aos in angular js it is showing the below error when ever i am trying to run ng serve? It is saying aos module is not declared?

Error: src/app/app.component.ts:3:22 - error TS7016: Could not find a declaration file for module 'aos'. 'C:/Users/greni/OneDrive/Desktop/angular/gameweb/node_modules/aos/dist/aos.js' implicitly has an 'any' type.
  Try `npm i --save-dev @types/aos` if it exists or add a new declaration (.d.ts) file containing `declare module 'aos';`

3 import * as AOS from 'aos'; code i have written in appcomponent.js

import { Component, OnInit } from '@angular/core';
import * as AOS from 'aos';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {
title = 'app';
ngOnInit() {
AOS.init(); }
}
zephryl
  • 14,633
  • 3
  • 11
  • 30
  • You can have a look at https://stackoverflow.com/questions/47253364/integrate-aos-library-with-angular4-application as I am also looking for the answer. – Naeem A. Oct 28 '22 at 17:22

0 Answers0