title: Is it not possible to store function as JSON key value in .json file in angular 5
body: <p>We have an Angular 5 project in which we have a <code>.json</code> file which we're loading in a <code>.ts</code> file using <a href="https://www.w3schools.com/xml/xml_http.asp" rel="nofollow noreferrer"><code>XMLHttpRequest</code></a>.</p>
  
  <p>The <code>.json</code> file have the following content:</p>
  
  <pre><code>{
      stringKey: "stringValue",
      functionKey: function() {
          console.log('function called!')
      }
  }
  </code></pre>
  
  <p>It throws the error: <code>[json] value expected</code></p>
  
  <p><a href="https://i.stack.imgur.com/PGcCJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PGcCJ.png" alt="json value expected"></a></p>
  
  <p>If I open Chrome Devtool and set the above object as value - it works fine but not in the project</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var obj = {
    stringKey: "stringValue",
    functionKey: function() {
      console.log('function called!')
    }
  }
  
  obj.functionKey();</code></pre>
  </div>
  </div>
  </p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Is there a work around for storing functions in pure JSON?</p>