var url = 'assets/json/data.json' //this url changes based on the environment
function() {
const data = require(url);
console.log(data);
}
I am unable to read the json data. It throws the error saying 'app.exceptions.ts:34 Error: Uncaught (in promise): Error: Cannot find module'
Please help.
urlto'./assets/json/data.json'if the file is located relative to the executing script, or'/assets/json/data.json'if relative to the host root