I'm looking for some help with this angularjs code.
When {{notification.label}}
changes from one value to another (the content of the table is from a database) I would like to add a new row. However I can't get it to work and mainly because I don't know how to get this done. Preferably I even close the table and create a new one but because the loop is in a TR I'm guessing this is not possible.
Looking for some direction and maybe an example. Already experimented with the If directive but wasn't able to compare old label with a new label.
<div id=postModule data-ng-app="postModule" data-ng-controller="PostController" data-ng-init="init()"
<form novalidate name="notificationForm">
<table class="table table-bordered table-hover table-striped">
<tr data-ng-repeat="notification in post.notification | orderBy : 'label'">
<td>
{{notification.label}}
</td>
<td>
{{notification.vendor}}
</td>
<td>
{{notification.product}}
</td>
<td>
{{notification.version}}
</td>
<td>
{{notification.cve}}
</td>
<td>
{{notification.cvsscore}}"
</td>
</tr>
</table>
</form>
</div>
Database:
notification.label || notification.vendor || notification.product
expensive || Samsung || Galaxy
expensive || Apple || iPhone
budget || Huawai || X
budget || Huawai || Y
I would like to see something like this (table)
notification.label || notification.vendor || notification.product
expensive || Samsung || Galaxy
expensive || Apple || iPhone
notification.label || notification.vendor || notification.product
budget || Huawai || X
budget || Huawai || Y
And even better when those are 2 seperated tables
notification.label || notification.vendor || notification.product
expensive || Samsung || Galaxy
expensive || Apple || iPhone
notification.label || notification.vendor || notification.product
budget || Huawai || X
budget || Huawai || Y