john_seattle (17) [Avatar] Offline
#1
Working through Chapter 7 code I found that the JSON data file must
be placed into the "/assets" folder. Also the data image links need to
have imageUrl's prefixed with "/assets/img/" not "data/img/". Thus,
the product.service.ts file references will change to
'/assets/products.json'.

-John from Seattle
Yakov Fain (215) [Avatar] Offline
#2
john_seattle (17) [Avatar] Offline
#3
I believe I found the reason that the data was not being accessed in the "/src/data"
folder. As I just read in book section 12.2, you declare in the angular-cli.json
(or angular.json file for Angular 6) the application "assets" as the following:

"assets": [
"src/assets",
"src/data",
"src/favicon.ico"
]

Since I built my application from scratch I did not have the "src/data" line
in my angular.json file. So including this line should allow data to be
read from the data folder. I'll try it out.

- John W. from Seattle