Sorry I removed everything from the state() so its all separate. so the
html has:
<div data-ui-view data-ng-controller="PageableController">
<div>Displaying Records {{ data.from }} - {{ data.to }} On
Page: {{bigCurrentPage}} / {{numPages}} / Of {{totalItems}} records.</div>
<pagination boundary-links="true" total-items="totalItems"
ng-model="currentPage" class="pagination-sm" previous-text="‹"
next-text="›" first-text="«" last-text="»"></pagination>
<pre>The selected page no: {{currentPage}}</pre>
<button type="button" class="btn btn-info" ng-click="setPage(3)">Set
current page to: 3</button>
<hr />
<h4>Limit the maximum visible buttons</h4>
<pagination total-items="bigTotalItems" ng-model="bigCurrentPage"
max-size="maxSize" class="pagination-sm" boundary-links="true"
rotate="false" num-pages="numPages"></pagination>
<pre>Page: {{bigCurrentPage}} / {{numPages}}</pre>
</div>
On Wednesday, September 16, 2015 at 7:30:07 PM UTC-2:30, Dave Abbott wrote:
>
> I had this working, reverted back to when it was but now I am getting a
> new error.
>
> Error: [$compile:tplrt] Template for directive 'pagination' must have
> exactly one root element. template/pagination/pagination.html
>
> http://errors.angularjs.org/1.3.13/$compile/tplrt?p0=pagination&p1=template%2Fpagination%2Fpagination.html
>
> My HTML:
>
> <div class="ng-cloak">Displaying Records {{ data.from }} - {{ data.to }}
> On Page: {{bigCurrentPage}} / {{numPages}} / Of {{totalItems}}
> records.</div>
> <pagination total-items="totalItems" ng-model="currentPage"
> ng-change="pageChanged()"></pagination>
>
> The info bar 1 of 5 pages data shows, colsole logs my dataset of records
> and it displays on the page but no paginator
>
> app.js has:
> angular.module('jobiedApp', [
> 'ngStorage',
> 'ngRoute',
> 'angular-loading-bar',
> 'ngResource',
> 'crudService',
> 'ui.router',
> 'ui.bootstrap'
> ])
>
> I am using the bundled ui.bootstrap of ui-bootstrap-tpls-0.13.4.js so it
> has the templates.
>
> in app.js i have for the .state:
>
> .state('dashboard.posts', {
> url: "/posts",
> templateUrl: "partials/posts/index.html",
> resolve:{
> services: "Crud",
> fetch: function (Crud, $stateParams) {
> return Crud.index('/posts');
> },
> },
>
> controller: function ($scope, Crud, fetch) {
> $scope.data = fetch.data;
>
> $scope.maxSize = 5;
> $scope.totalItems = $scope.data.total;
> $scope.currentPage = $scope.data.current_page;
> $scope.bigTotalItems = $scope.data.total;
> $scope.bigCurrentPage = $scope.data.current_page;
> $scope.numPages = $scope.data.last_page;
> }
> })
>
> Any ideas where I screwed this up?
>
> Thanks,
>
> Dave
>
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.