So for example I want to use a cottonjs (dont have a d.ts file) library. And in angular.json O twice write
"scripts": ["../node_modules/cottonjs/cotton.js"]
and in my component I tried to declare it
import {Component, OnInit} from '@angular/core';
declare var Cotton:any;
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
ngOnInit() {
console.log(Cotton)
}
}
But every time when I tried to use some libraries in console I see this:
ERROR ReferenceError: Cotton is not defined
at AppComponent.ngOnInit (app.component.ts:11:17)
at callHook (core.mjs:2542:1)
at callHooks (core.mjs:2511:1)
at executeInitAndCheckHooks (core.mjs:2462:1)
at refreshView (core.mjs:9501:1)
at renderComponentOrTemplate (core.mjs:9600:1)
at tickRootContext (core.mjs:10854:1)
at detectChangesInRootView (core.mjs:10879:1)
at RootViewRef.detectChanges (core.mjs:21491:1)
at ApplicationRef.tick (core.mjs:26563:1)
P.s dont work there too Heeeeeeeelp please