简体   繁体   中英

setting up plnkr for angularjs pagination not working

I am new to using plnkr. I have created my first plnkr and facing an issue in setting the $scope.currentPage variable. All other variables are working fine except the currentPage. I am using the angular-utils-pagination directive. Once I click on the page number the variable is getting printed but when the page gets loaded for the first time the variable is not initialized. Please let me know where I am going wrong. The link for the plnkr - Link

The problem is that you are injecting $scope into your MyApp directive. There's no need to do this since directives have access to their parent scope by default. So it should look like this:

angular.module('myApp').directive('myTable', function () 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM