Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ng2-translate (404 not found) I've added it in system.js

I've installed ng2-translate to my proj and console error keep showing 404 of the bundle and xhr error. I've added ng2-translate to my system.config.js that comes with the standard angular2 quickstart but still showing 404 and xhr error.

It's either giving me 404 error or annotation of undefined error :/

github: thread regarding the issue using systemconfig.js

https://github.com/ocombe/ng2-translate/issues/167

var map = {
    'app':                        'app', // 'dist',
    '@angular':                   'node_modules/@angular',
    'angular2-in-memory-web-api': 'node_modules/angular2-in-memory-web-api',
    'ng2-translate':              'node_modules/ng2-translate',
    'rxjs':                       'node_modules/rxjs'
  };

Edit:

var packages = {
    'ng2-translate':              { main: 'ng2-translate.js', defaultExtension: 'js' },
  };
like image 941
nCore Avatar asked Jul 11 '16 10:07

nCore


1 Answers

I faced to the same issue today

solution is this:

put 'ng2-translate': 'node_modules/ng2-translate/bundles' in system.config.js in the map and 'ng2-translate' : { defaultExtension: 'js' } in packages

enter image description here

like image 130
gsiradze Avatar answered Sep 22 '22 20:09

gsiradze