Get a local json file on NativeScript

后端 未结 4 807
伪装坚强ぢ
伪装坚强ぢ 2021-01-18 07:29

How to get a local big json data?

I have tried this, but I had no success:

var sa = require(\"./shared/resources/sa.json\");
var array = new observab         


        
4条回答
  •  一生所求
    2021-01-18 08:10

    I just wanted to add one more thing, which might be even easier. You can simply write the content of your JSON file in a data.js file, or whatever name you would like to use, and export it as an array. Then you can just require the data.js module.

提交回复
热议问题