angularjs - Angular print string array without quotes -
i have simple string array coming server:
[{"things":["me", "my"]}]
in page, display array have:
{{things}}
and prints:
["me", "my"]
how control printing, instance, if want eliminate brackets , quotes?
you can implement scope function display arrays comma separated strings shown in this fiddle.
$scope.array = ["tes","1","2","bla"]; $scope.arraytostring = function(string){ return string.join(", "); };
now can call function within template:
{{arraytostring(array)}}
update
you can use join()
method of arrays directly within template without using function inbetween displayed within updated fiddle.
{{array.join(", ")}}
Comments
Post a Comment