Using ionic2.
None of the above solutions helped me.
However, after launch:
npm install sprintf-js --save npm install --save @types/sprintf
I managed to use require('sprintf-js') in my app.ts file.
After that, vsprintf and sprintf worked while I added
declare var vsprintf:any; declare var sprintf:any;
at the top of the ts file that used them.
source share