Well, that's interesting question. If you find an answer before anyone else, then post it here, so we all can find it easily.
BTW: I have such a problem: in one variable I have value which should be always bigger than in second one. The tricky part is: sometimes the second variable does not exist. How can I check for all the possibilities? Thanks, Witold Szczerba --- Sent from my mobile phone. On May 31, 2014 12:11 PM, "'kacha haan' via AngularJS" < [email protected]> 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 [email protected]. > To post to this group, send email to [email protected]. > 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
