New to angular. Please excuse me if this is a very simple question.
Is there anyway to convert array to string. My controller her the code:
$scope.addRow = function addRow(){
$scope.filters.push({ 'Name':$scope.name, 'dept': $scope.dept, 'city':$scope.city});
$scope.name='';
$scope.dept='';
$scope.city='';
};
Now, I want to sent this data to a service as a string
I want it in the format "name,dept,city;name,dept,city". Is there any way to do it?
Service code looks like this:
$scope.submit = function() {
myService.submit({
filters :$scope.filters
}, function(response) {
$scope.response = response;
});
};
I want to pass the value to filters in format "name,dept,city;name,dept,city" from the array. Thanks in advance.
var myString = stringA + "," + stringB;