paan
paan

Reputation: 355

Import function from js file in a ts file (angular 2)

I have a JavaScript file that contains some functions, I want to import those functions in a ts file, I have tried using the technique below but it didn't work

import * as downloadExport from "./leaflet_export";

It raises the following error:

enter image description here

Any ideas about how to import functions from a js file into ts file??

Upvotes: 1

Views: 634

Answers (1)

wannadream
wannadream

Reputation: 1760

See documentation here: https://www.typescriptlang.org/docs/handbook/compiler-options.html

--allowJs boolean false(defacult value) Allow JavaScript files to be compiled.

Upvotes: 2

Related Questions