Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

148
Views
When I truing to use some js libraries with no d.ts I have errors

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

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!