How to hide the pagination bar if the number of pages is less than the number of items per page in angular

306
February 25, 2017, at 10:04 AM

I'm trying to hide the pagination bar when the number of pages to render is smaller than the number of items per page. I tried with ng-show but it didn't work.

        <tr ng-repeat="row in allItems">
                    <td>{{ row.Name }}</td>
                    <td>{{ row.Email }}</td>
                    <td>{{ row.Phone }}</td>
                </tr>
          </tbody>
        <tfoot ng-show="allItems.length > itemsPerPage">
                <tr>                
                    <td></td>
                    <td></td>   
                    <td st-pagination="" st-items-by-page="itemsPerPage" st-template="/example/pagination.html" >
                    </td>
                </tr>
       </tfoot>   
Answer 1

try putting brackets around the condition, like ng-show="(allItems.length>itemsPerPage)

Rent Charter Buses Company
READ ALSO
Calling A Javascript Function in a Parent Window from a link inside an iFrame

Calling A Javascript Function in a Parent Window from a link inside an iFrame

I've got a parent page and a child page issue involving JavaScript functions back and forthThe basic idea (this is for a menu system on a mobile site for thousands of pages of content) is that there is a NAV on the parent page which is hidden using CSS (z-index)...

444
running Js test getting error window is defined

running Js test getting error window is defined

running JS tests using karma + jasmine

373
Semantic UI dropdown user addition only allow email address

Semantic UI dropdown user addition only allow email address

The dropdown is being used to allow the visitor to search for users/email addresses or enter in a custom email address

804
Finding text within complex html document structure with javascript

Finding text within complex html document structure with javascript

I am writing an automation script that will pull information from a dynamically generated webpageI cannot control the information on it, thus I am having trouble referencing the information

278