Abhith
Abhith

Reputation: 306

Angular app broken because of a single line of code in Safari Only, Working in all other browsers

I'm not sure why the below piece of code broke the entire app in Safari browser. The commented line of code broke the App on compile.

    if (history.selectedRegions) {
       for (var i = 0; i < history.selectedRegions.length; i++) {
       // vm.selectedRegions.push(vm.allRegion[vm.allRegion.map((el) => el.nameEng).indexOf(history.selectedRegions[i].nameEng)]);
       }
   }

Upvotes: 0

Views: 86

Answers (1)

karaxuna
karaxuna

Reputation: 26940

Try es5:

vm.selectedRegions.push(vm.allRegion[vm.allRegion.map(function (el) {
    return el.nameEng;
}).indexOf(history.selectedRegions[i].nameEng)]);

Upvotes: 1

Related Questions