It's a pojo so you can just use array notation:  $scope.items[0]

-r -v

> On May 31, 2014, at 6:10 AM, "'kacha haan' via AngularJS" 
> <angular@googlegroups.com> wrote:
> 
> Howdy !
> 
> Does anyone know how one can simply read an object from an array.
> 
> Say one has a list like $scope.items and want read the object at a given 
> index.
> 
> Like one can add ($scope.items.push) or remove ($scope.items.splice) an item 
> object what is Angular's way to read ($scope.items.????) an item.
> 
> function ItemController($scope, Item) {  
>      // scope init:
>     $scope.items = Item.query();
>     
>     $scope.selectItem = function(index) {
>         $scope.selectedItem = $scope.items.????;
>         alert("selected item is: " + $scope.selectedItem);
>     };
>  }
> 
> Any hints are welcome.
> 
> kacha
> -- 
> You received this message because you are subscribed to the Google Groups 
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to angular+unsubscr...@googlegroups.com.
> To post to this group, send email to angular@googlegroups.com.
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to