I have an Angular 4 application built with Webpack, and I am trying to serve a JSON file. Two questions:
- In simplest case, JSON file is static. I can't figure out how to set up webpack to include
myfile.jsonthe way I include images. That said, if I look at URL of any image on the page, it comes asassets/angular.9db278d630f5fabd8e7ba16c2e329a3a.png. I would prefer to have a simpler URL for my JSON. - In less simpler case, I build the file programmatically. Building a JSON string is, obviously, not a problem, but displaying it is. I looked at examples how to display a PDF, but all of them require plug-in, and most just call
window.openin a different window. Since Angular components are displayed within a tag on a web page, I am having trouble "breaking out" of the page.
Is it even possible? I realize, I asked two questions, but I'll be happy with an answer to either one; not to both :)