Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AnViL999
New Contributor

Visual.ts import assets/file.geojson

Hello,

 

How can I import from assets a file called file.geojson into visual.ts? I currently have the value stored in visual.ts itself.

 

I am having a hard time finding the answer online.

 

With kind regards,

 

AnViL

 

1 ACCEPTED SOLUTION
dm-p
Honored Contributor

Hi @AnViL999,

 

Add "resolveJsonModule": true to your tsconfig.json file's compilerOptions.

 

You can then import a JSON file into your code as a variable.

 

TypeScript doc

 

I use this in pretty much all visuals I write, and some examples can be seen in Deneb [tsconfig | usage in a file, with link to import lines].

 

Good luck!

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

2 REPLIES 2
dm-p
Honored Contributor

Hi @AnViL999,

 

Add "resolveJsonModule": true to your tsconfig.json file's compilerOptions.

 

You can then import a JSON file into your code as a variable.

 

TypeScript doc

 

I use this in pretty much all visuals I write, and some examples can be seen in Deneb [tsconfig | usage in a file, with link to import lines].

 

Good luck!

 

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




AnViL999
New Contributor

@dm-p 

That did the trick! Thank you

Helpful resources

Announcements
Users online (4,584)