'Pass data from index.html to env.const.js

index.html

<script>
    window._DEFAULT_DATA = {'id' : '123'}
 </script>

env.const.js

  var config =  window._DEFAULT_DATA        // <------------ getting error

Getting error as:- window is not defined

How to get _DEFAULT_DATA from index.html to env.const.js



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source