Yes it is in the controller. I have tried various attempts and the new
revised looks like:
angular.module('pageableCtrl',[])
.controller('PageableController', ['$scope', '$location', '$state',
'$log',
function ($scope, $location, $state, $log) {
alert('pageable');
$scope.totalItems = 64;
$scope.currentPage = 4;
$scope.setPage = function (pageNo) {
$scope.currentPage = pageNo;
};
$scope.pageChanged = function() {
$log.log('Page changed to: ' + $scope.currentPage);
};
/$scope.maxSize = 5;
$scope.bigTotalItems = 175;
/$scope.bigCurrentPage = 1;
}]);
I have removed just about everything
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.