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

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -