I have a a controller that generates $scope.product = response.data
In my html template if type {{ product }} it shows the requested metadata in an array including the id and name. However, unless I go through the ng-repeat do ng-repeat='item in product' it won't print id and an name even though I have only one record.
For example {{ product.id }} and {{ product.name }} can be displayed only as {{ item.id }} and {{ item.name }}
I have even tried $scope.product.id = response.data.id and $scope.product.name = response.data.name
Use Case:
- Print the product name and other information on a card
- Use product.id to take other actions e.g. add to cart.