i have json provides me user's working experiences info. country , city's provided in code format (tr,de etc.) using ng-repeat pass them html this
<div ng-repeat="e in experiences"> <span>{{e.name}}</span> <span ng-init="changecodetofullname(e.country)">{{vm.countryfullname[$index]}}</span> </div>
i using ng-init convert country code full name. changecodetofullname angular service written me, correct method? if is, can't access dom change countryfullname value. tried access them in js file vm.countryfullname[0]="test"
didn't worked. need use e.country variable after, therefore can't change original .e.country value.
how can access variable inside of ng-repeat after ng-repeat completed?
how using custom filter:
<div ng-repeat="e in experiences"> <span>{{e.name}}</span> <span>{{e.country | changecodetofullname}}</span> </div> angular.module('app').filter('changecodetofullname', function(yourservice) { return function(country) { return yourservice.getfullcountryname(country) } })
here's example: http://codepen.io/rustydev/pen/ywyqjb