0

I have following inputs in table:

<input type="checkbox" name="slection"  ng-click="addEntryToSelection(entry)" value="{{entry.defaultName}}">

How can i get which items are cheked and get their values after button ng-click or how can i add value into array if is checked and remove after uncheck?

Thanks for any help.

0

1 Answer 1

1

you could do like this.

<input type="checkbox" name="slection"  ng-click="addEntryToSelection(entry)" value="{{entry.defaultName}}" ng-model="toggleInfo.checked" ng-change="toggleChange">

in controller.

function toggle(){
     console.log('check!');
 }

 var change = ($scope.toggleChange==true ? toggle() : /*false*/);

 //persist the check value where you could assign to services;
 if ($scope.toggleChange==true){
     $scope.toggleInfo = { checked: true };
 } else {
     $scope.toggleInfo = { checked: false };
 }
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.