Satyadev Satyadev - 1 year ago 140
AngularJS Question

Pagination shown even though there is no data in angular

Here is my code:


<li ><a data-ng-click="Data1 = true;Data2 = false; search.status = ''" href="">ALL PROJECTS</a></li>
<li ><a data-ng-click="Data2 = true;Data1 = false" href="">NOTIFICATIONS</a></li>

Populated data on click of button:

<li ng-show="Data1" dir-paginate="wd in workOrdersList | filter: search.status | filter: | itemsPerPage: 10">
<a href="">
<p>Status: {{wd.status}}</p>

<li ng-show="Data2">
<div ng-show="!notificationDataDashord.length">
<span>No Notifications</span>
<dir-pagination-controls auto-hide="true"></dir-pagination-controls>

Inside the controller:

$scope.Data1 = true;
$scope.Data2 = false;

I am using pagination directive from this link:

Answer Source

Its a problem with the dirpagination that it doesnt update the collections after you load the data again.


As a work around obviously

<dir-pagination-controls ng-show="Data1" auto-hide="true"></dir-pagination-controls>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download