This is not an angular problem as much as a general javascript problem.
Your click handler sets the $selected attribute of the clicked user to
true. So, if you want to make it so selecting one row unselects all the
other rows, you have to do that on your own.  I did:

    $scope.changeSelection = function(user) {
      $scope.data.forEach(function(u){
        u.$selected = false;
      });
      user.$selected = true;
    }

It's not terribly efficient, but it works. Personally, if I were building a
mutexed selection model, I'd do it by not stashing $selected on the model
itself, but in the view. ($scope.view.selectedRow = 2), ng-class =
{'active': view.selectedRow == $index}. But that's more of an opinion than
anything else.

e


On Sat, Aug 30, 2014 at 7:10 PM, <[email protected]> wrote:

> hi
> am katherine :)
>
> am new to angularjs  am having hard time figuring out how to tweak
> http://plnkr.co/edit/YD4yXc?p=preview
>
> so that when i select a row "ONLY THE SINGLE   ROW CONTENTS MUST BE
> DISPLAYED IN" selected users and
> and previous history of selected rows shoudnt be their..? somethng like
> radio button select
> only one coloum contents must be their in selected users "NO previous
> select history"
>
> --
> 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.

Reply via email to