December 2017
Beginner
372 pages
10h 32m
English
In our Trello application, we are fetching the Boards and Tasks from a JSON file inside the API folder. To successfully run the application, we want to make sure that the file is served by Angular. This is done by defining the assets in the assets tag of the Angular CLI JSON file as shown in the following code snippet:
"assets": [ "assets", "favicon.ico", "api/board/boards.json" ],
Here, we see in the last line that we have defined the path where our JSON file is placed. Apart from that, we have two more entries, one for the assets folder and one for the favicon. The Angular CLI uses this entry in the assets tag to determine which static files need to be served, which in our case is the board.json file.
Read now
Unlock full access