Remove Double Quotes from Array in Angularjs

How to remove quotes from array

You have to convert the string values into number values. You can do that by adding a + in front of them, like this:

return points.map(function(ap) {
return {
layer: 'realworld',
lat: +ap.lat,
lng: +ap.lng
};
});

How to remove double quotes from JSON Array

Try this:

let objectArray = json.map((each)=>{return JSON.parse(each)});
console.log(objectArray) // This will give you the required output

How to remove double quotes on link title attributes using expression data?

The reason you're getting ["text", "text 1", "text 2"] is because you're displaying an array with string in it; if you want a string that looks like [Text, Text 1, Text 2] then you can pipe the output through a function:

  $scope.change = function(a){
a = a.map(function(x){
return x.replace(/^[a-z]/,function(m){
return m.toUpperCase()
});
});
return "["+a.join()+"]";
};

and in your view you just use it like:

<ul ng-repeat="list in names">                                  
<li ng-repeat="lists in list.bookmarks">
<a href="{{lists.link}}" data-toggle="tooltip" data-placement="right" title="{{change(lists.tags)}}">{{lists.title}}</a></li>

</ul>
jsbin

you could also use angular filters to do it, but in the end the concept is : filter the data to obtain a modified output.

Hot to remove first and last double quotes in Angular 4?

try binding to innerHTML

<div [innerHTML]="response"></div>

How to remove double quotes from dynamic url genereted from the select options In Angularjs?

Remove JSON.stringify from the url

var url="http://192.168.206.133:8080/admin/metering/samples?"+"meter="+$scope.metric.label+"&group_by="+$scope.group_by.label+"&stats_attr="+$scope.stats_attr.label+"&date_options="+$scope.date_option.value+"&date_from=&date_to=";

http://plnkr.co/edit/uvqwbBttzPRXgIQLOEOL?p=preview



Related Topics



Leave a reply



Submit