javascript - How can i get values from this $scope using angularjs? -
i getting selecteditems
in console
[{"model":"lumia","brand":"nokia","submodel":["lumia 735 ts","lumia 510"],"city":"bangalore"}]
i stoed in $scope.details var selecteditems = $location.search().items; $scope.details =[{"model":"lumia","brand":"nokia","submodel":["lumia 735 ts","lumia 510"],"city":"bangalore"}]
how can model , brand , submodel city in above variable
my expectation :
i have put not getting value
console.log($scope.details.model);
i should lumia
console.log($scope.details.brand);
i should nokia
console.log($scope.details.submodel);
i should "lumia 735 ts","lumia 510"
since $scope.details
array, have use index object contains properties want access.
$scope.details[0].model $scope.details[0].brand; $scope.details[0].submodel;
this means accessing first object in array , property model of object.
Comments
Post a Comment