Reputation: 111
I am trying to execute a JS code in the Angular typescript, it is a code that is not mine, the case is that the code outside Angular works perfectly, once inside the compiler I get many errors, among them I cannot solve this:
(function (global, factory) {
console.log("Adminlscn.js en uso");
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = global || self, factory(global.adminlte = {}));
}(this, (function (exports) { 'use strict';....
I don't know why it doesn't catch or define or global, typescript is supposed to be an extension of JS, all js code should work
The terminal give me that mistake:
But the @types has been installed and i have this at tsconfig.json:
Upvotes: 0
Views: 103
Reputation: 71911
TypeScript doesn't know what these things are. You need to declare them for the compiler. Add this above the function, so that the compiler doesn't complain anymore. You can add typings instead of any
if you want:
declare define: any;
declare global: any;
Upvotes: 1