0
votes

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?

1
can you type localhost:4200/assets/i18n/en.json in your browser if it is 404 or OK?angularrocks.com
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
Show me how you reference that file in your code.angularrocks.com
i dont know where is the reference from... beacuse is a tamplate. the first time i opened it , the error appeardIxam Deirf

1 Answers

2
votes

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');
}