我正在使用Angular CLI的最新版本。我有一些模擬http調用引用本地json'../app/myfile.json'等。爲了在重載過程中停止獲取404,我必須將它們添加到某處嗎?我試着調整.angular-cli.json中的路徑,但不斷收到404錯誤。角度cli在實時重載期間包含額外的靜態資源?
@angular/cli: 1.0.4
node: 6.9.4
os: darwin x64
@angular/animations: 4.1.3
@angular/common: 4.1.3
@angular/compiler: 4.1.3
@angular/core: 4.1.3
@angular/forms: 4.1.3
@angular/http: 4.1.3
@angular/material: 2.0.0-beta.5
@angular/platform-browser: 4.1.3
@angular/platform-browser-dynamic: 4.1.3
@angular/router: 4.1.3
@angular/cli: 1.0.4
@angular/compiler-cli: 4.1.3
我試圖修改.angular-cli.json來添加我想包含的文件夾。
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico",
"mocks"
],
當我重裝我得到:http://localhost:4200/app/mocks/myfile.json(404未找到)
任何幫助表示讚賞。
吉米
那麼,你嘗試做什麼,你在哪裏嘗試放置文件,你在執行什麼代碼,以及你會得到什麼錯誤? –
嗨在那裏,我已經添加了一些關於這個問題的細節。基本上我試圖修改.angular-cli.json以包含我需要的文件夾,但這沒有任何區別。 – Jimi