0

I am using this template:

https://github.com/start-angular/SB-Admin-BS4-Angular-4

On ng serve it is always throwing an error in console:

GET http://localhost:4200/start-angular/SB-Admin-BS4-Angular-4/master/dist/assets/i18n/en.json 404 (Not Found) - zone.js:2263

ERROR Response {_body: "↵↵↵↵↵↵", status: 404, ok: false, statusText: "Not Found", headers: Headers, …} core.es5.js:1020

How would you fix that error?

angularrocks.com
  • 26,767
  • 13
  • 87
  • 104
Ixam Deirf
  • 425
  • 2
  • 6
  • 14
  • can you type http://localhost:4200/assets/i18n/en.json in your browser if it is `404` or OK? – angularrocks.com Aug 24 '17 at 04:22
  • show this : { "dashboard": "Dashboard", "charts": "Charts", "tables": "Tables", "forms": "Forms", "boostrapElement": "Boostrap Element", "boostrapGrid": "Boostrap Grid", "component": "Component", "menu": "Menu", "submenu": "Submenu", "blankpage": "Blank Page", "moretheme": "More Themes", "downloadNow": "Download Now", "language": "Language" } – Ixam Deirf Aug 24 '17 at 04:23
  • Show me how you reference that file in your code. – angularrocks.com Aug 24 '17 at 04:25
  • i dont know where is the reference from... beacuse is a tamplate. the first time i opened it , the error appeard – Ixam Deirf Aug 24 '17 at 04:25

1 Answers1

2

You have a wrong path to en.json
It should be something like http://localhost:4200/assets/i18n/en.json

UPDATE:
I just looked in to source. You need play with app.module.ts file lines 14 and 13 https://github.com/start-angular/SB-Admin-BS4-Angular-4/blob/master/src/app/app.module.ts#L14

export function HttpLoaderFactory(http: Http) {
    // for development
    // return new TranslateHttpLoader(http, '/start-angular/SB-Admin-BS4-Angular-4/master/dist/assets/i18n/', '.json');
    return new TranslateHttpLoader(http, '/assets/i18n/', '.json');
}
angularrocks.com
  • 26,767
  • 13
  • 87
  • 104