valor-software / ng2-select

Angular based replacement for select boxes
http://valor-software.github.io/ng2-select/
MIT License
675 stars 587 forks source link

translate value with ng2-translate #537

Open yarikmlb opened 7 years ago

yarikmlb commented 7 years ago

I need to change value.text with ng2-translate library. How can I do it? My project has two languages Dutch and English.

GiantFlash commented 7 years ago
yourarray.forEach(function (item) {
      translate.get(item.TEXT).subscribe(result => {
         item.TEXT= result;
      });
    })

then push it to your selectItemArray {id: item.ID, text: item.TEXT}