I'm using the smart-table with pagination. Also there is a default selected item (isSelected=true).
What I want to achieve is that the pagination goes to the actual page of the table where the selected item is.
I tried to get the $scope from the pagination, to access the selectPage() function.But I cannot get the $scope.
angular.element($('#pagination')).scope()
returns the controller $scope
angular.element($('#pagination')).isolatedScope()
returns null
Edit:
Here's the plnkr.
Is it possible to get the scope from a directive? I want the get the scope from this directive
Here's the table html:
<table st-table="table" st-pipe="pipeFunction" st-safe-src="rowCollection" class="table table-striped">
...
<tfoot>
<tr>
<td colspan="5">
<div id="pagination" st-pagination="" st-items-by-page="8" st-template="/scripts/angular/pagination.custom.html"></div>
</td>
</tr>
</tfoot>
</table>
isSelected- charlietfl