angularjs - Angular translate static files loader with html-backend -


i have json traslations page gets loaded static files loader works fine, when use $httpbackend simulate api calls doesnt load. config looks this:

    $translateprovider.usestaticfilesloader({         prefix: "assets/lang-",         suffix: ".json"     });*/     $translateprovider.useinterpolation('textbreaksinterpolation');     $translateprovider.preferredlanguage('en'); 

i have whitelisted assets in htmlbackend this:

$httpbackend.whenget(/assets.*/).respond(200, ''); 

any suggestions? thanks.

i suggest not use lazy loading @ all. (of course, if don't have many languages).

just build text json file bundle:

import textsen 'texts.en.json'; import textsde 'texts.de.json'; import textses 'texts.es.json';  .config($translateprovider => {   $translateprovider.translations('en', textsen);   $translateprovider.translations('de', textsde);   $translateprovider.translations('es', textses); }) 

Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -