For example, I have this string
recipe.Tags = "Filipino Cuisine,Easy";
and I want to convert it to the array below.
$scope.tags = [{ Name: "Filipino Cuisine" },
{ Name: "Easy"},
];
I could use the code below but then it would only work for strings with 2 tags.
$scope.tags = [ { Name: recipe.Tags.split(',')[0] },
{ Name: recipe.Tags.split(',')[1] },
];