Upon printing selecteditems
to the console, this is the output:
[{"model":"Lumia","brand":"Nokia","subModel":["Lumia 735 TS","Lumia 510"],"city":"Bangalore"}]
I have stored it in $scope.details as follows: var selecteditems = $location.search().items; $scope.details =[{"model":"Lumia","brand":"Nokia","subModel":["Lumia 735 TS","Lumia 510"],"city":"Bangalore"}]
How can I extract the model, brand, subModel and city from the variable above?
My expected outcome is:
I tried the following but did not receive any value:
console.log($scope.details.model);
I should get Lumia
console.log($scope.details.brand);
I should get Nokia
console.log($scope.details.subModel);
I should get "Lumia 735 TS", "Lumia 510"