admin管理员组文章数量:1336592
i am trying to write a directive to generate pagination links using the concept used in a simplePagination the prev and next links are the only links being generated and clicking them generates an error:
Uncaught SyntaxError: Unexpected token :
here is the fiddle /
Edit 1
got the rest of the links to show but the bi-directional binding '=' does not seem to work.
here is the new fiddle /
i am trying to write a directive to generate pagination links using the concept used in a simplePagination the prev and next links are the only links being generated and clicking them generates an error:
Uncaught SyntaxError: Unexpected token :
here is the fiddle http://jsfiddle/kelvo/zZURe/
Edit 1
got the rest of the links to show but the bi-directional binding '=' does not seem to work.
here is the new fiddle http://jsfiddle/kelvo/zZURe/7/
Share Improve this question edited Dec 31, 2012 at 10:35 klvmungai asked Dec 31, 2012 at 9:54 klvmungaiklvmungai 8241 gold badge13 silver badges21 bronze badges1 Answer
Reset to default 6You were updating a piece of code outside of angular and needed to let angular know to reprocess itself.
$scope.selectPage = function(pageIndex) {
$scope.currentPage = pageIndex;
$scope.draw();
$scope.$apply();
}
I added the $scope.$apply(); and now the currentPage updates correctly in the input. Here are the docs on the $apply method: http://docs.angularjs/api/ng.$rootScope.Scope#$apply
jsfiddle: http://jsfiddle/zZURe/14/
本文标签: javascriptAngularjs Pagination directiveStack Overflow
版权声明:本文标题:javascript - Angularjs Pagination directive - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742410238a2469639.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论