Angular remove table row on submit
NickName:Coeus Ask DateTime:2016-05-20T17:31:22

Angular remove table row on submit

Im new to angular and I was trying to remove some elements from table on submit..

<tr ng-repeat="val in values ">
    <td ng-bind="$index"></td>
    <td ng-bind="val.rec">ED1500322</td>
    <td>working</td>
    <td ng-bind="val.result">I am going to School</td>
    <td>
      <div class="radio">
        <input ng-model="val.iscorrect" value="yes" type="radio" ng-change="log(val)">
        <label for="opt1">yes</label>
        <input ng-model="val.iscorrect" value="no" type="radio" ng-change="log(val)">
        <label for="opt10">no</label>
      </div>
    </td> 
  </tr>

All the data obtained using ng-repeat and Im not sure of remove data which is obtained dynamically

I wanted to remove row if the toggle button is clicked..(to show there was some changes done)

Plunker http://plnkr.co/edit/kNJUbUBENxBc38rBg3GK?p=preview

Any help in removing data dynamically would be helpful..Thanks in advance

Copyright Notice:Content Author:「Coeus」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/37343047/angular-remove-table-row-on-submit

Answers
PeO Kessman 2016-05-20T10:08:31

Set a value on button-click like this:\n\n<button ng-click=getResult();hideme=true>getResult</button>\n\nand then use ng-hide on the table row where val.iscorrect is not true\n\n <tr ng-repeat=\"val in values\" ng-hide=\"hideme && val.iscorrect!='yes'\">\n <td ng-bind=\"$index\"></td>\n <td ng-bind=\"val.rec\">ED1500322</td>\n <td>working</td>\n <td ng-bind=\"val.result\">I am going to School</td>\n <td>\n <div class=\"radio\">\n <input ng-model=\"val.iscorrect\" value=\"yes\" type=\"radio\" ng-change=\"log(val)\">\n <label for=\"opt1\">yes</label>\n <input ng-model=\"val.iscorrect\" value=\"no\" type=\"radio\" ng-change=\"log(val)\">\n <label for=\"opt10\">no</label>\n </div>\n </td> \n </tr>\n",


More about “Angular remove table row on submit” related questions

Angular remove table row on submit

Im new to angular and I was trying to remove some elements from table on submit.. &lt;tr ng-repeat="val in values "&gt; &lt;td ng-bind="$index"&gt;&lt;/td&gt; &lt;td ng-bind="va

Show Detail

How to Remove a row from Table using angular js?

I am using Angular http service to perform a DELEET operation , Its working fine , after deleting the data record I have to remove that row also from table . Below is my code for all that $scope.

Show Detail

Angular Material Table | Add Remove rows at runtime

I am using Angular Material Table that is backed by a plain array as the data source. this.employees = this.route.snapshot.data.employes; // of type Employee[] resolved using a Resolve guard this.

Show Detail

Scroller move to top of table when remove row from data table jquery plugin

I am using data table in my angular js Application as angular Directive and passing data to it using "=" scope.When remove row using row.remove.draw() scroller moves to top of table. This is my cod...

Show Detail

how to remove the data also from the removed row of the table in angular

I have an add new row button as well as remove a row button. At First, I added multiple rows with data in it. But when I remove one of the rows out of the table it gets removed but data is still...

Show Detail

Can not remove the expected row from table using Angular.js

I have an issue.I need to remove one particular row from table structure of my app using Angular.js.My code is present inside the below plunkr link. code is present here In the above code create ...

Show Detail

submit a row data in dynamic table

I made a dynamic table with checkbox. I only want to submit the data in checked row to the form. I try to use checkbox array index but that does not work. What should I do to only submit the data i...

Show Detail

Angular material table with expanded rows to be sticky, once it has been scrolled past to remove that sticky row

I am using angular material table v11.1.0 having a main row with expand rows on it, that main row would be sticky once you expanded the row and as well as when you scroll the table. I would like to

Show Detail

Angular table-sort and drag and drop table row conflict

I am using angular table-sort and angular drag-drop in my project. When I am dragging a row and trying to drop it to another row, then table sort forcefully sort the rows to their previous position...

Show Detail

remove table row and ajax call

I want to remove remove table row from table and subsequently remove the item from database also. The html generated is from ajax call at page load that gets the html from the php file. $.ajax({ ...

Show Detail